VS Code - Cygwin as an integrated terminal

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

So my question is: can I use Cygwin integrated into the VS Code terminal and use it to use commands ( mkdir, rmetc.) on it, but also use git commands and use it as an integrated compiler and debugger (usually but not for C ++)? And how would I do that?

+4
source share
2 answers

These configuration 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"
  ],
}
+12
source

You can simply call Cygwin.batwithout problem with ENV:

{
    // Replace with your Cygwin.bat file path 
    "terminal.integrated.shell.windows": "C:\\cygwin64\\Cygwin.bat",
}

Make sure the BAT scripts match your Cygwin.

+2
source

Source: https://habr.com/ru/post/1685112/


All Articles