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:
chere package. (You might have to start Cygwin once to initialize it, not sure)// Cygwin, with chere package installed
"terminal.integrated.shell.windows": "C:\\Cygwin\\bin\\bash.exe",
"terminal.integrated.shellArgs.windows": ["/bin/xhere", "/bin/bash"],
uname -a.So please add the three lines above to https://code.visualstudio.com/docs/editor/integrated-terminal
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"]
Most helpful comment
Got it working with: