我已经安装了 console2 和 git bash,我的目标是让 git bash 与 tabs 一起工作,我已将控制台设置上的目标路径更改为
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i
. 当我打开控制台时,它不再给我选项卡选项。
8 回答
我已经用 ConEmu 来代替它了。
http://sourceforge.net/projects/conemu/
- 安装 Git Bash
- 安装 ConEmu
- 打开ConEmu,在设置中(右上角),点击“设置”
- 在设置树中,打开“启动”,然后打开“任务”
- 添加新任务,或编辑现有任务之一
- 单击底部第二行的“选项卡”按钮
- 在第一个框中,输入“[git目录]\bin\sh.exe --login -s”
- 在第二个框中,输入您首选的启动目录
- 节省
- 现在分配一个热键(右上角)(我在 ctrl+T 上有我的)
- 你完成了!现在您在 Windows 中有一个多选项卡式控制台,您可以在其中通过热键创建任意数量的 Git Bash 窗口。
- 安装 Git Bash -> Git for Windows v2.9.3
- 安装 ConEMU 版本 10.0.17134.48 --> https://conemu.github.io/en/Downloads.html
- ConEMU 最新版本预配置了 gitbash 和 windows cmd。无需进行任何设置
- 打开ConEMU
- 使用新的控制台对话框选项打开 windows cmd -> ConEMU 中的 {Shells::cmd}
- 使用新的控制台对话框选项打开 git bash -> ConEMU 中的 {Bash::Git bash}
Using VSCode IDE
You can use multiple GIT Bash tabs inside VSCode, if you use it as IDE.
Press CTRL + SHIFT + ' to open the terminal. You will se a dropdown to the right where you can select bash as default shell if you have GIT Bash installed. You can then use multiple tabs within VSCode.
这是Windows Terminal的解决方案:
- 打开设置 (
Ctrl + ,
) - 将此添加到
profiles
属性中(记得在它之前添加一个逗号{...}
):
"profiles":
{
...
"list":
[
...
{
"commandline": "C:\\path\\to\\git\\bin\\bash.exe --login -i",
"hidden": false,
"icon": "C:\\path\\to\\git\\mingw64\\share\\git\\git-for-windows.ico",
"name": "Git Bash",
"startingDirectory": "%USERPROFILE%"
}
]
},
- (可选)如果您希望 Git Bash 在您启动 Windows 终端时成为默认 shell,请将其添加到设置中:
"defaultProfile": "Git Bash",
更新
电源外壳
Console2 与 powershell 一起工作。转到编辑 => 设置 => 选项卡 => 添加选项卡 => 将外壳设置为:%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe
并将标题设置为“Powershell”。安装 git bash 后,powershell 无需进一步配置即可工作。
动车组
我发现ConEmu的设置窗口很难使用。我放弃了设置默认目录。我使用这个设置:
在 ConEmu 中单击按钮时要小心。它会覆盖你在命令中输入的任何内容,并且按钮添加的样板代码似乎不适用于 Git shell。
你应该改变壳牌。我认为您更改了启动目录。