我可以强制使用 Visual Studio 2022 > git >打开命令提示符以使用 Git Bash 而不是 cmd?

发布于 01-16 02:57 字数 105 浏览 2 评论 0原文

使用 Visual Studio 2022,我想使用 Git 菜单选项“在命令提示符中打开”来打开 Git Bash 终端,而不是 cmd.exe。

我如何配置 VS 来做到这一点?

Using Visual Studio 2022, I want to use the Git menu option Open In Command Prompt to open a Git Bash terminal as opposed to cmd.exe.

How do I configure VS to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

盛装女皇2025-01-23 02:57:49

虽然没有集成到该菜单,但我能够将 git bash 添加到终端窗口。

通过选择查看>终端(或 ctrl + '),然后选择设置 cog 并设置以下内容:

Git Bash settings

我能够从 VS 中打开 gitbash shell。

请注意,通过将 Shell 位置设置为 C:\Program Files\Git\git-bash.exe,控制台将在其自己的窗口中加载控制台的新实例,方法是将其设置为 C:\Program Files\Git\bin \sh.exe,它集成在终端窗格中。

While not integrating to that menu, I was able to add git bash to the terminal window.

By choosing View > Terminal (or ctrl + ') and then selecting the settings cog and setting the following:

Git Bash settings

I am able to open a gitbash shell from within VS.

Note, that by setting the Shell location to C:\Program Files\Git\git-bash.exe, the console loads a new instance of the console in its own window, by setting it to C:\Program Files\Git\bin\sh.exe, it is integrated in the Terminal Pane.

甜味拾荒者2025-01-23 02:57:49

除了您自己的回答@StuperUser,您可以按如下方式设置终端:
Git Bash Terminal

这是从我的 Windows 终端配置中获取的,它自动添加了 Git Bash 配置文件。参数为 -i(用于交互式)和 -l(用于登录 shell)。

您还可以尝试 Mads Kristensen 的开放命令行扩展 - 它有点有效,但是有一些怪癖。

Further to your own answer @StuperUser, you can set the Terminal up as follows:
Git Bash Terminal

This was taken from my Windows Terminal config when it added the Git Bash profile automatically. The arguments are -i for interactive and -l for login shell.

You could also try Mads Kristensen's Open Command Line Extension - it kind of works but has some quirks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文