我查看了 VSCode 設定,我看不清楚“集成”是什么意思,但這就是我所擁有的,但它會加載外部 powershell 組態檔。我想阻止它這樣做,有可能嗎?
PS:我沒有也不想要 powershell 擴展,我應該有這個選項嗎?
更新:正如建議的那樣,我在用戶和作業區設定中都未選中“powershell.enableProfileLoading”,重新啟動了vscode,但在終端中仍然出現“正在加載個人和系統組態檔”,奇怪的是它仍然對我不起作用?
這可能是 VSCode 設定錯誤嗎?
uj5u.com熱心網友回復:
如果您確實安裝了 Visual Studio Code 的PowerShell 擴展,并且您想禁止在其專用外殼中加載組態檔,則PowerShell 集成控制臺(PIC):
GUI 選項:通過“設定”對話框,取消選中該選項
PowerShell: Enable Profile LoadingSettings.json檔案選項:正如Santiago Squarzon所說,添加以下設定:"powershell.enableProfileLoading": false
如果您沒有安裝 PowerShell 擴展,或者您(還)想要控制在 Visual Studio 的集成終端中運行的通用PowerShell 會話的組態檔加載:
在“設定”對話框中,搜索
terminal profiles并單擊適用于平臺的條目Edit in settings.json旁邊的鏈接,其中之一是、或(macOS)。Terminal ? Integrated ? Profiles: <os><os>windowslinuxosx這將打開您的
Settings.json檔案進行編輯,并創建或導航到一個預先存在的"terminal.integrated.profiles.<os>"物件,該物件包含集成終端中所有可用外殼的組態檔。找到 PowerShell 組態檔并添加一個
"args": [ "-noprofile" ]屬性以抑制組態檔加載,該屬性在啟動時將-noprofile引數傳遞給 PowerShell CLI(powershell.exe對于 Windows PowerShell,pwsh對于 PowerShell (Core) 7 );例如,在Windows上:
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell",
"args": [ "-noprofile" ]
},
// ...
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/483459.html
