Skip to content

Commit

Permalink
Update fish shell integration support
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Dec 16, 2022
1 parent cf8b54f commit 5707d56
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions docs/terminal/shell-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Visual Studio Code has the ability to integrate with common shells, allowing the

Supported shells:

- Linux/macOS: bash, pwsh, zsh
- Linux/macOS: bash, fish, pwsh, zsh
- Windows: pwsh

## Installation
Expand All @@ -41,6 +41,15 @@ Add the following to your `~/.bashrc` file. Run `code ~/.bashrc` in bash to open
[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path bash)"
```

**fish**

Add the following to your `config.fish`. Run `code $__fish_config_dir/config.fish` in fish to open the file in VS Code.

```sh
string match -q "$TERM_PROGRAM" "vscode"
and . (code --locate-shell-integration-path fish)
```

**pwsh**

Add the following to your [PowerShell profile](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.2). Run `code $Profile` in pwsh to open the file in VS Code.
Expand All @@ -67,17 +76,6 @@ Add the following to your `~/.bashrc` file. Run `code ~/.bashrc` in Git Bash to
[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path bash)"
```

**fish**

⚠️ This is currently experimental and automatic injection is not supported

Add the following to your `config.fish`. Run `code $__fish_config_dir/config.fish` in fish to open the file in VS Code.

```sh
string match -q "$TERM_PROGRAM" "vscode"
and . (code --locate-shell-integration-path fish)
```

#### Portability versus performance

The recommended approach above to install shell integration relies on executing our CLI to find the path to the shell integration script. This is great as it works cross-platform and also with all install types, provided `code` in on the `$PATH`. This currently launches Node.js in order to fetch the path, which can add a small delay to shell startup. To reduce this, you can inline the script above by resolving the path ahead of time and adding it directly into your init script.
Expand Down

0 comments on commit 5707d56

Please sign in to comment.