Skip to content

Commit f812052

Browse files
committed
Docs: Add Cygwin shell integration instructions
1 parent da1872b commit f812052

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docs/features/shell-integration.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,44 @@ For optimal shell integration with WSL, we recommend:
270270

271271
## Known Issues and Workarounds
272272

273+
### Cygwin (bash, zsh)
274+
275+
Cygwin provides a Unix-like environment on Windows systems. To configure Cygwin as your terminal in VS Code:
276+
277+
1. Install Cygwin from [https://www.cygwin.com/](https://www.cygwin.com/)
278+
279+
2. Open VS Code settings:
280+
- Select File > Preferences > Settings
281+
- Click the "Open Settings (JSON)" icon in the top right corner
282+
283+
3. Add the following configuration to your `settings.json` (inside the top-level curly braces `{}`):
284+
```json
285+
{
286+
"terminal.integrated.profiles.windows": {
287+
"Cygwin": {
288+
"path": "C:\\cygwin64\\bin\\bash.exe",
289+
"args": ["--login"],
290+
"env": {"CHERE_INVOKING": "1"}
291+
}
292+
},
293+
"terminal.integrated.defaultProfile.windows": "Cygwin"
294+
}
295+
```
296+
297+
> Note: If you have 32-bit Cygwin installed, use `"C:\\cygwin\\bin\\bash.exe"` for the path.
298+
299+
4. Understanding the configuration:
300+
- `path`: Points to the Bash executable in your Cygwin installation
301+
- `args`: The `--login` flag ensures the shell reads profile files
302+
- `env`: The `CHERE_INVOKING` environment variable tells Cygwin to use the current directory as the working directory
303+
- `terminal.integrated.defaultProfile.windows`: Sets Cygwin as the default terminal profile
304+
305+
5. To open a new Cygwin terminal:
306+
- Press Ctrl+Shift+(backtick) to open a new terminal, or
307+
- Press `F1`, type "Terminal: Create New Terminal (with Profile)", and select "Cygwin"
308+
309+
While our testing shows that this works out of the box, if you encounter shell integration issues with Cygwin, ensure you have added the appropriate shell integration hooks to your Cygwin bash profile as described in the "Manual Shell Integration Installation" section.
310+
273311
### VS Code Shell Integration for Fish + Cygwin on Windows
274312

275313
For fellow Windows users running Fish terminal within a Cygwin environment, here's how VS Code's shell integration works:

0 commit comments

Comments
 (0)