bash VSCode 集成终端创建一个单独的窗口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47474379/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
VSCode Integrated Terminal creates a separate window
提问by Elliot
Just installed VSCode and git bash.
刚刚安装了 VSCode 和 git bash。
I've added the following lines to the settings.json file:
我已将以下几行添加到 settings.json 文件中:
{
"terminal.integrated.shell.windows": "D:\Program Files\Git\git-bash.exe"
}
When I press Ctr+` to open the integrated shell window, instead of opening inside the main editor at the bottom it opens a new window:
当我按 Ctr+` 打开集成的 shell 窗口时,它不是在底部的主编辑器中打开,而是打开一个新窗口:
Why isn't it showing in the usual place?
为什么它不在通常的地方显示?
采纳答案by JDB still remembers Monica
According to this vscoode GitHub Issue (#7286):
...
git-bash.exe
is a Windows application (with WinMain as entry), butbash.exe
is a console application (with main as entry). To be used as integrated shell, the executable must be a console application, so that stdin/stdout/stderr can be redirected.
...
git-bash.exe
是一个 Windows 应用程序(以 WinMain 作为入口),但它bash.exe
是一个控制台应用程序(以 main 作为入口)。要用作集成 shell,可执行文件必须是控制台应用程序,以便可以重定向 stdin/stdout/stderr。
The recommended approach is to use:
推荐的方法是使用:
"terminal.integrated.shell.windows": "C:\Program Files\Git\bin\bash.exe"
回答by Aadn
I was infact looking for the solution to this exact problem. @JBD said it correctly however I would just like to add that the git-bash.exe file is kept seperate in the normal program folder of git.
事实上,我正在寻找这个确切问题的解决方案。@JBD 说得对,但我只想补充一点,git-bash.exe 文件单独保存在 git 的正常程序文件夹中。
{
"terminal.integrated.shell.windows": "D:\Program Files\Git\git-bash.exe"
}
but what you need to link within vs Codes settings is a different file which will enable git bash to run within the vs code terminal. The path to that is in the "bin" folder within the "Git" folder.
但是您需要在 vs Codes 设置中链接的是一个不同的文件,它将使 git bash 能够在 vs Code 终端中运行。其路径位于“Git”文件夹内的“bin”文件夹中。
{
"terminal.integrated.shell.windows": "D:\Program Files\Git\bin\bash.exe"
}
This will allow your git bash to run from within the terminal window of VS Code
这将允许您的 git bash 从 VS Code 的终端窗口中运行
回答by Batman
On Mac.
在 Mac 上。
- Right click Visual Studio Code Application, open new window. press
- ctrl+` to open terminal in new window.
- Enjoy your day.
- 右键单击 Visual Studio Code 应用程序,打开新窗口。按
- ctrl+` 在新窗口中打开终端。
- 祝您愉快。
-Batman P.S. Disregard, was looking at another page that was trying to create a separate window to run terminal in.
-Batman PS Disregard,正在查看另一个页面,该页面试图创建一个单独的窗口来运行终端。