You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Add Documentation of Shell Integration for Cygwin + Fish Setup (#138)
* docs(shell-integration): add Fish+Cygwin setup for VSCode
- Document setup for Fish terminal in Cygwin within VS Code.
- Provide step-by-step guide for shell integration.
- Include workaround for VSCode terminal profile configuration.
- Add visual aid for integration verification.
* docs(shell-integration): update Fish+Cygwin setup instructions
Fix grammar errors
* docs(shell-integration): clarify fish terminal setup
- Update shell integration instructions for clarity by referring manual installation above
Copy file name to clipboardExpand all lines: docs/features/shell-integration.md
+77Lines changed: 77 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -228,6 +228,83 @@ For optimal shell integration with WSL, we recommend:
228
228
229
229
## Known Issues and Workarounds
230
230
231
+
### VS Code Shell Integration for Fish + Cygwin on Windows
232
+
233
+
For fellow Windows users running Fish terminal within a Cygwin environment, here's how VS Code's shell integration works:
234
+
235
+
1.**(Optional) Locate the Shell Integration Script:**
236
+
Open your Fish terminal *within VS Code* and run the following command:
237
+
```bash
238
+
code --locate-shell-integration-path fish
239
+
```
240
+
This will output the path to the `shellIntegration.fish` script. Note down this path.
241
+
242
+
2. **Update Your Fish Configuration:**
243
+
Edit your `config.fish` file (usually located at `~/.config/fish/config.fish` within your Cygwin home directory). Add the following line, preferably within an `if status is-interactive` block or at the very end of the file:
244
+
245
+
```fish
246
+
# Example config.fish structure
247
+
if status is-interactive
248
+
# Your other interactive shell configurations...
249
+
# automatic locate integration script:
250
+
string match -q "$TERM_PROGRAM""vscode"; and . (code --locate-shell-integration-path fish)
251
+
252
+
# Or if the above fails for you:
253
+
# Source the VS Code shell integration script
254
+
# IMPORTANT: Replace the example path below with the actual path you found in Step 1.
255
+
# Make sure the path is in a format Cygwin can understand (e.g., using /cygdrive/c/...).
*Remember to replace the example path with the actual path from Step 1, correctly formatted for Cygwin.*
260
+
261
+
3. **Configure VS Code Terminal Profile:**
262
+
Open your VS Code `settings.json` file (Ctrl+Shift+P ->"Preferences: Open User Settings (JSON)"). Update or add the Fish profile under `terminal.integrated.profiles.windows` like this:
263
+
264
+
```json
265
+
{
266
+
// ... other settings ...
267
+
268
+
"terminal.integrated.profiles.windows": {
269
+
// ... other profiles ...
270
+
271
+
// Recommended: Use bash.exe to launch fish as a login shell
272
+
"fish": {
273
+
"path": "C:\\cygwin64\\bin\\bash.exe", // Or your Cygwin bash path
274
+
"args": [
275
+
"--login", // Ensures login scripts run (important for Cygwin environment)
276
+
"-i", // Ensures bash runs interactively
277
+
"-c",
278
+
"exec fish" // Replace bash process with fish
279
+
],
280
+
"icon": "terminal-bash" // Optional: Use a recognizable icon
281
+
}
282
+
// Alternative (if the above fails): Launch fish directly
283
+
"fish-direct": {
284
+
"path": "C:\\cygwin64\\bin\\fish.exe", // Ensure this is in your Windows PATH or provide full path
285
+
// Use 'options' here instead of 'args'; otherwise, you might encounter the error "terminal process terminated exit code 1".
286
+
"options": ["-l", "-c"], // Example: login and interactive flags.
287
+
"icon": "terminal-fish" // Optional: Use a fish icon
288
+
}
289
+
},
290
+
291
+
// Optional: Set fish as your default if desired
292
+
// "terminal.integrated.defaultProfile.windows": "fish", // or "fish-direct" depending what you use.
293
+
294
+
// ... other settings ...
295
+
}
296
+
```
297
+
*Note: Using `bash.exe --login -i -c "exec fish"` is often more reliable in Cygwin environments for ensuring the correct environment setup before `fish` starts. However, if that approach doesn't work, try the `fish-direct` profile configuration.*
298
+
299
+
4. **Restart VS Code:**
300
+
Close and reopen Visual Studio Code completely to apply the changes.
301
+
302
+
5. **Verify:**
303
+
Open a new Fish terminal in VS Code. The shell integration features (like command decorations, better command history navigation, etc.) should now be active. You can test basic functionality by running simple commands like `echo "Hello from integrated Fish!"`. <img src="/img/shell-integration/shell-integration-8.png" alt="Fish Cygwin Integration Example" width="600" />
304
+
305
+
This setup works reliably on Windows systems using Cygwin, Fish, and the Starship prompt, and should assist users with similar configurations.
306
+
307
+
231
308
### Shell Integration Failures After VSCode 1.98
232
309
233
310
**Issue**: After VSCode updates beyond version 1.98, shell integration may fail with the error "VSCE output start escape sequence (]633;C or ]133;C) not received".
0 commit comments