Skip to content

Commit

Permalink
Update manual install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Jul 14, 2022
1 parent 36838a8 commit 28e183a
Showing 1 changed file with 16 additions and 50 deletions.
66 changes: 16 additions & 50 deletions docs/editor/terminal-shell-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,65 +27,31 @@ This standard, easy way will not work for some advanced use cases like in sub-sh

### Manual installation

To manually install shell integration, the VS Code shell integration script needs to run during your shell's initialization. Where and how to do this depends on the shell and OS you're using.
To manually install shell integration, the VS Code shell integration script needs to run during your shell's initialization. Where and how to do this depends on the shell and OS you're using. When using manual install it's recommended to set `terminal.integrated.shellIntegration.enabled` to `false`, though not mandatory.

When using manual install it's recommended to set `terminal.integrated.shellIntegration.enabled` to `false`, though not mandatory.
#### bash

> ℹ️ The method for calling the script will be simplified in the future (see [vscode#153921](https://github.com/microsoft/vscode/issues/153921))
Add the following to your `~/.bashrc` file. Run `code ~/.bashrc` in bash to open the file in VS Code.

#### Windows

The script below contains `<InstallDir>` which must be replaced by VS Code's installation directory. This defaults to:

- User install: `$env:HOMEPATH\AppData\Local\Programs\Microsoft VS Code\`
- System install: `C:\Program Files\Microsoft VS Code`

**pwsh**

Add the following to your [PowerShell profile](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.2), replacing `<InstallDir>` with VS Code's installation directory. Run `code $Profile` in pwsh to open the file in VS Code.

```pwsh
if ($env:TERM_PROGRAM -eq "vscode") {
. "<InstallDir>\resources\app\out\vs\workbench\contrib\terminal\browser\media\shellIntegration.ps1"
}
```

#### Linux and macOS

The script below contains `<InstallDir>` which must be replaced by VS Code's installation directory. This defaults to:

- Linux: Find by running `echo "$(readlink -f "$(which code)")../resources"`
- macOS: `/Applications/Visual\ Studio\ Code.app/Contents/Resources`

**bash**

Add the following to your `~/.bashrc` file, replacing `<InstallDir>` with VS Code's installation directory. Run `code ~/.bashrc` in bash to open the file in VS Code.

```sh
if [ "$TERM_PROGRAM" == "vscode" ]; then
. <InstallDir>/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
fi
```
```sh
[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --shell-integration bash)"
```

**pwsh**
#### pwsh

Add the following to your [PowerShell profile](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.2), replacing `<InstallDir>` with VS Code's installation directory. Run `code $Profile` in pwsh to open the file in VS Code.
Add the following to your [PowerShell profile](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.2). Run `code $Profile` in pwsh to open the file in VS Code.

```pwsh
if ($env:TERM_PROGRAM -eq "vscode") {
. "<InstallDir>/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration.ps1"
}
```
```pwsh
if ($env:TERM_PROGRAM -eq "vscode") { . "$(code --shell-integration pwsh)" }
```

**zsh**
#### zsh

Add the following to your `~/.zshrc` file. Run `code ~/.zshrc` in bash to open the file in VS Code.
Add the following to your `~/.zshrc` file. Run `code ~/.zshrc` in bash to open the file in VS Code.

```sh
if [[ "$TERM_PROGRAM" == "vscode" ]]; then
. <vscode resources install path>/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh
fi
```
```sh
[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --shell-integration zsh)"
```

## Features

Expand Down

0 comments on commit 28e183a

Please sign in to comment.