我看过VSCode的设置,我看不清楚"集成"&;意思是我有,但它加载外部powershell配置文件。我想阻止它这样做,这是可能的吗?
注::我没有也不想要powershell扩展,我应该有这个选项吗?
更新:正如建议的那样,我已经勾选了powershell.enableProfileLoading"在用户和工作空间设置中,重新启动vscode,但在终端中仍然显示"加载个人和系统配置文件";奇怪的是,它仍然不适合我?
是否有可能是VSCode设置错误?
-
如果你已经安装了Visual Studio Code的PowerShell扩展并且你想要在其专用shell中抑制概要文件的加载,PowerShell集成控制台(PIC):
-
GUI选项:通过设置对话框,取消选项
PowerShell: Enable Profile Loading
-
Settings.json
文件选项:正如Santiago square所说,添加以下设置:"powershell.enableProfileLoading": false
-
-
如果您没有安装PowerShell扩展,或者您(也)想控制配置文件加载通用PowerShell会话
-
在Settings对话框中,搜索
terminal profiles
并单击与平台相关的Terminal › Integrated › Profiles: <os>
条目旁边的Edit in settings.json
链接,其中<os>
是windows
,linux
或osx
(macOS)中的一个。 -
这将打开您的
Settings.json
文件进行编辑,并创建或导航到预先存在的"terminal.integrated.profiles.<os>"
对象,其中包含集成终端中可用的所有shell的配置文件。 -
找到PowerShell配置文件并添加
"args": [ "-noprofile" ]
属性以抑制配置文件加载,该配置文件在启动时将-noprofile
参数传递给PowerShell命令行(Windows PowerShell为powershell.exe
, PowerShell (Core) 7+为pwsh
);例如,在Windows上:
-
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell",
"args": [ "-noprofile" ]
},
// ...
}