VS Code-Cygwin作为集成终端 [英] VS Code - Cygwin as Integrated Terminal

查看:452
本文介绍了VS Code-Cygwin作为集成终端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Cygwin作为Windows笔记本电脑上Visual Studio Code的集成终端(因为这将使我可以使用Linux终端命令git和G ++等),但是当我为<$ c设置值时$ c> terminal.integrated.shell.windows:到Cygwin应用程序的地址( .exe ),然后打开一个新的Cygwin终端,而不是保留在VS Code中。

I would like to use Cygwin as the integrated terminal on Visual Studio Code on my Windows laptop (as this would give me use of the Linux terminal commands git and G++, etc.) but when I set the value for "terminal.integrated.shell.windows": to the address of the Cygwin application (.exe) then it opens a new Cygwin terminal rather than remaining in VS Code.

所以我的问题是:我可以使用集成到VS Code终端中的Cygwin并使用它在其上使用命令( mkdir rm 等),还使用git命令并将其用作集成的编译器和调试器(至少对于C ++而言)?我该怎么办?

So my question is: can I use Cygwin integrated into the VS Code terminal and use that to use commands on it (mkdir, rm, etc.) but also use git commands and use it as an integrated compiler and debugger (for generically but for C++ at least)? And how would I go about this?

推荐答案

这些配置设置对我有用:

These config settings work for me:

{
  // start bash, not the mintty, or you'll get a new window
  "terminal.integrated.shell.windows": "C:\\cygwin\\bin\\bash.exe",
  // Use this to keep bash from doing a 'cd ${HOME}'
  "terminal.integrated.env.windows": {
    "CHERE_INVOKING": "1"
  },
  // Make it a login shell
  "terminal.integrated.shellArgs.windows": [
    "-l"
  ],
}

这篇关于VS Code-Cygwin作为集成终端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆