Skip to content

Commit 1fa6a3f

Browse files
KJ7LNWEric Wheelerhannesrudolph
authored
docs: add Cygwin terminal configuration for Windows users (#225)
Co-authored-by: Eric Wheeler <[email protected]> Co-authored-by: hannesrudolph <[email protected]>
1 parent 9d84679 commit 1fa6a3f

File tree

1 file changed

+42
-5
lines changed

1 file changed

+42
-5
lines changed

docs/features/shell-integration.md

Lines changed: 42 additions & 5 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:
@@ -331,6 +369,9 @@ For fellow Windows users running Fish terminal within a Cygwin environment, here
331369
},
332370
333371
// Optional: Set fish as your default if desired
372+
---
373+
374+
## Known Issues and Workarounds
334375
// "terminal.integrated.defaultProfile.windows": "fish", // or "fish-direct" depending what you use.
335376
336377
// ... other settings ...
@@ -369,9 +410,6 @@ This setup works reliably on Windows systems using Cygwin, Fish, and the Starshi
369410
- Try enabling some or all ZSH-related workarounds in Roo settings
370411
- These settings can help regardless of your operating system
371412
372-
---
373-
374-
## Known Issues and Workarounds
375413
376414
### Ctrl+C Behavior
377415
@@ -383,7 +421,7 @@ This setup works reliably on Windows systems using Cygwin, Fish, and the Starshi
383421
384422
**Issue**: Commands that span multiple lines can confuse Roo and may show output from previous commands mixed in with current output.
385423
386-
**Workaround**: Instead of multi-line commands, use command chaining with `&&` to keep everything on one line (e.g., `echo a && echo b` instead of typing each command on a separate line).
424+
**Workaround**: Instead of multi-line commands, use command chaining with `&amp;&amp;` to keep everything on one line (e.g., `echo a &amp;&amp; echo b` instead of typing each command on a separate line).
387425
388426
### PowerShell-Specific Issues
389427
@@ -397,7 +435,6 @@ This setup works reliably on Windows systems using Cygwin, Fish, and the Starshi
397435
**Issue**: Sometimes VS Code doesn't show or capture all the output from a command.
398436
399437
**Workaround**: If you notice missing output, try closing and reopening the terminal tab, then run the command again. This refreshes the terminal connection.
400-
401438
---
402439
403440
## Troubleshooting Resources

0 commit comments

Comments
 (0)