我的设置设为:
"terminal.integrated.shell.windows":"C:\\msys64\\usr\\bin\\bash.exe",
"terminal.integrated.shellArgs.windows": ["-i"],
"terminal.integrated.env.windows": {
"PATH": "/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/"
},
这正常工作,但是要将终端更改为Cmd Prompt,我必须手动将设置更改为:
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe"
我尝试使用Shell Launcher扩展程序来简化终端之间的切换,但这不适用于mingw bash。我使用扩展程序来运行Octave gui,效果很好。我猜是因为通过此扩展启动时没有为Shell指定路径。我还能做些什么吗?
"shellLauncher.shells.windows": [
{
"shell": "C:\\Windows\\System32\\cmd.exe",
"label": "Cmd Prompt"
},
{
"shell": "C:\\Windows\\<sysnative>\\WindowsPowerShell\\v1.0\\powershell.exe",
"label": "PowerShell"
},
{
"shell": "C:\\msys64\\usr\\bin\\bash.exe",
"label": "mingw bash"
},
{
"shell": "C:\\Octave\\Octave-5.2.0\\mingw64\\bin\\octave-gui.exe",
"label": "Octave gui"
}
],
答案 0 :(得分:1)
{
"shell": "C:\\msys64\\usr\\bin\\bash.exe",
"label": "mingw bash",
"env" : {"PATH": "/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/"
}
}