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
kevinneung edited this page Apr 29, 2025
·
21 revisions
Note: I've created a minimal reproducible environment to help report issues with VSCode 1.93's new Terminal Shell Integration API. If the troubleshooting steps below don't resolve your issue, please follow the steps in that repository to report the problems you encounter.
Shell integration is a new feature in VSCode 1.93 that allows extensions like Cline to run commands in your terminal and read their output. Command output allows Cline to react to the result of the command on his own, without you having to handhold by copy-pasting the output in yourself. It's also quite powerful when running development servers as it allows Cline to fix errors as the server logs them.
How to Fix "Shell Integration Unavailable"
Step 1: Update VSCode or Cursor
First, make sure you're using the latest version of VSCode or Cursor:
Open VSCode or Cursor
Press Cmd + Shift + P (Mac) or Ctrl + Shift + P (Windows/Linux)
Type "Check for Updates" (VSCode) or "Attempt Update" (Cursor) and select it
Restart VSCode/Cursor after the update
Step 2: Configure VSCode to Use the Correct Shell
Open VSCode
Press Cmd + Shift + P (Mac) or Ctrl + Shift + P (Windows/Linux)
Type "Terminal: Select Default Profile" and choose it
Select one of the supported shells: zsh, bash, fish, or PowerShell.
Step 3: Restart VSCode
After making these changes:
Quit VSCode completely
Reopen VSCode
Start a new Cline session (you can resume your previous task and try to run the command again, this time with Cline being able to see the output)
Additional Troubleshooting for Windows Users
If you're using Windows and still experiencing issues with shell integration after trying the previous steps, it's recommended you use Git Bash.
Git Bash
Git Bash is a terminal emulator that provides a Unix-like command line experience on Windows. To use Git Bash, you need to:
You may also need to adjust your PowerShell execution policy. By default, PowerShell restricts script execution for security reasons.
Understanding PowerShell Execution Policies
PowerShell uses execution policies to determine which scripts can run on your system. Here are the most common policies:
Restricted: No PowerShell scripts can run. This is the default setting.
AllSigned: All scripts, including local ones, must be signed by a trusted publisher.
RemoteSigned: Scripts created locally can run, but scripts downloaded from the internet must be signed.
Unrestricted: No restrictions. Any script can run, though you will be warned before running internet-downloaded scripts.
For development work in VSCode, the RemoteSigned policy is generally recommended. It allows locally created scripts to run without restrictions while maintaining security for downloaded scripts. To learn more about PowerShell execution policies and understand the security implications of changing them, visit Microsoft's documentation: About Execution Policies.
Steps to Change the Execution Policy
Open PowerShell as an Administrator: Press Win + X and select "Windows PowerShell (Administrator)" or "Windows Terminal (Administrator)".
Check Current Execution Policy by running this command:
Get-ExecutionPolicy
If the output is already RemoteSigned, Unrestricted, or Bypass, you likely don't need to change your execution policy. These policies should allow shell integration to work.
If the output is Restricted or AllSigned, you may need to change your policy to enable shell integration.
Change the Execution Policy by running the following command:
Run code $Profile in the terminal to open your PowerShell profile.
Add the following line to the file:
if ($env:TERM_PROGRAM -eq "vscode") { ."$(code --locate-shell-integration-path pwsh)" }
Unusual Terminal Output
If you're seeing unusual output with rectangles, lines, escape sequences, or control characters, it may be related to terminal customization tools. Common culprits include:
Powerlevel10k: A zsh theme that adds visual elements to the prompt
Oh My Zsh: A framework for managing zsh configurations
Fish shell themes
To troubleshoot:
Temporarily disable these tools in your shell configuration file (e.g., ~/.zshrc for Zsh)
If the issue resolves, gradually re-enable features to identify the conflicting component
For example, if you're using Powerlevel10k with Zsh, you can disable it by commenting out the relevant line in your ~/.zshrc file:
# Comment out the Powerlevel10k source line# source /path/to/powerlevel10k/powerlevel10k.zsh-theme
If disabling these customizations resolves the issue, you may need to find alternative configurations that are compatible with VSCode's shell integration feature.
OneDrive Windows Users
If you’re using Windows and have OneDrive enabled on your PC, your desktop directory path might differ from a typical user. Terminal processes will look to launch from C:\Users<user>\Desktop, while Onedrive users will have a desktop path that looks like C:\Users<user>\Onedrive\Desktop. To solve this, we can create a symbolic link from the expected Desktop location to the actual OneDrive Desktop location.