Skip to content

Commit 7a2e104

Browse files
author
Eric Wheeler
committed
docs: add Cygwin terminal configuration for Windows users
Add detailed instructions for configuring Cygwin as a terminal in VS Code for Windows users: - Installation steps for Cygwin - VS Code settings.json configuration with explanation of parameters - Instructions for setting Cygwin as the default terminal - Guidance on opening Cygwin terminals - Note about shell integration compatibility This helps Windows users who prefer Cygwin's Unix-like environment to properly configure it with shell integration support. Signed-off-by: Eric Wheeler <[email protected]>
1 parent 7d40cc6 commit 7a2e104

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docs/shell-integration.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,44 @@ If you'd still like to use PowerShell, make sure you're using an updated version
108108
- Check your current PowerShell version by running: `$PSVersionTable.PSVersion`
109109
- If your version is below 7, [update PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.4#installing-powershell-7).
110110

111+
### Cygwin (bash, zsh)
112+
113+
Cygwin provides a Unix-like environment on Windows systems. To configure Cygwin as your terminal in VS Code:
114+
115+
1. Install Cygwin from [https://www.cygwin.com/](https://www.cygwin.com/)
116+
117+
2. Open VS Code settings:
118+
- Select File > Preferences > Settings
119+
- Click the "Open Settings (JSON)" icon in the top right corner
120+
121+
3. Add the following configuration to your `settings.json` (inside the top-level curly braces `{}`):
122+
```json
123+
{
124+
"terminal.integrated.profiles.windows": {
125+
"Cygwin": {
126+
"path": "C:\\cygwin64\\bin\\bash.exe",
127+
"args": ["--login"],
128+
"env": {"CHERE_INVOKING": "1"}
129+
}
130+
},
131+
"terminal.integrated.defaultProfile.windows": "Cygwin"
132+
}
133+
```
134+
135+
> Note: If you have 32-bit Cygwin installed, use `"C:\\cygwin\\bin\\bash.exe"` for the path.
136+
137+
4. Understanding the configuration:
138+
- `path`: Points to the Bash executable in your Cygwin installation
139+
- `args`: The `--login` flag ensures the shell reads profile files
140+
- `env`: The `CHERE_INVOKING` environment variable tells Cygwin to use the current directory as the working directory
141+
- `terminal.integrated.defaultProfile.windows`: Sets Cygwin as the default terminal profile
142+
143+
5. To open a new Cygwin terminal:
144+
- Press Ctrl+Shift+(backtick) to open a new terminal, or
145+
- Press `F1`, type "Terminal: Create New Terminal (with Profile)", and select "Cygwin"
146+
147+
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.
148+
111149
#### Understanding PowerShell Execution Policies
112150

113151
PowerShell uses execution policies to determine which scripts can run on your system. Here are the most common policies:

0 commit comments

Comments
 (0)