Vscode: Docs: Add Cygwin terminal

Created on 4 Nov 2016  路  3Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.7.1
  • OS Version: Win10

With the new command line options for Windows integrated terminal, it now is finally possible to start a proper working Cygwin terminal in the current project. GREAT!

For that you need to have base Cygwin and the chere package installed. There is not need to run the chere command and integrate Cygwin with your Explorer. The chere package is just needed for the /bin/xhere command that comes with it.

When you only use C:\\Cygwin\\bin\\bash.exe (so without these command line options) the Cygwin path is not set properly and bash is useless. And when you start C:\\Cygwin\\Cygwin.bat your path is set, but you end up in $HOME and not in the right directory.

Steps to reproduce:

  1. Install base Cygwin and add the chere package. (You might have to start Cygwin once to initialize it, not sure)
  2. Add these lines to the Workbench Settings:
// Cygwin, with chere package installed
"terminal.integrated.shell.windows": "C:\\Cygwin\\bin\\bash.exe",
"terminal.integrated.shellArgs.windows": ["/bin/xhere", "/bin/bash"],
  1. Open the terminal in VSCode and see a proper working Cygwin terminal (apart from #7345) appear in the current directory. In doubt type uname -a.

So please add the three lines above to https://code.visualstudio.com/docs/editor/integrated-terminal

debt integrated-terminal

Most helpful comment

Got it working with:

"terminal.integrated.shell.windows": "C:\\Cygwin64\\bin\\bash.exe",
"terminal.integrated.shellArgs.windows": ["/bin/xhere", "/bin/zsh"]

All 3 comments

Since this is a very specific quirk to Cygwin I don't think I'll add this, especially since other bash.exe's seem to work just fine so it will likely be fixed eventually.

This solution does not work with zsh instead of bash. The terminal opens and immediately closes. Anyway to debug this?

Got it working with:

"terminal.integrated.shell.windows": "C:\\Cygwin64\\bin\\bash.exe",
"terminal.integrated.shellArgs.windows": ["/bin/xhere", "/bin/zsh"]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

trstringer picture trstringer  路  3Comments

DovydasNavickas picture DovydasNavickas  路  3Comments

villiv picture villiv  路  3Comments

vsccarl picture vsccarl  路  3Comments

lukehoban picture lukehoban  路  3Comments