如何在VsCode终端中与cmd提示符一起运行MSyS2 Mingw64 bash?

问题描述 投票:1回答:1

我的设置设为:

"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,效果很好。我猜是因为通过此扩展启动时没有为外壳指定Path。我还能做些什么吗?

"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"
        }
    ],
visual-studio-code mingw-w64 msys2
1个回答
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/"
            }
        }
© www.soinside.com 2019 - 2024. All rights reserved.