Skip to main content

Try this first: background execution mode

The simplest fix for most terminal issues is switching to background execution mode.
1

Open Cline settings

Click Settings in the top right corner of the Cline chat panel.
2

Go to Terminal Settings

Select the Terminal Settings tab from the left column.
3

Switch execution mode

Set Terminal Execution Mode to Background Exec.
Background execution mode runs commands in a separate process instead of VS Code’s integrated terminal, bypassing most shell integration issues.

VS Code integrated terminal fixes

If you need to use VS Code’s integrated terminal, try the following fixes.
Shell integration allows Cline to capture command output from the terminal. If it isn’t working, verify that it is enabled in VS Code.
  1. Open VS Code Settings (Cmd/Ctrl + ,).
  2. Search for terminal.integrated.shellIntegration.enabled.
  3. Make sure the setting is enabled.
  4. Close and reopen the terminal.
If the problem persists, increase the shell integration timeout:
  1. In Cline, click Settings > Terminal Settings.
  2. Set Shell integration timeout (seconds) to 10.
If Cline runs commands but doesn’t capture their output, try switching the default shell to bash:
  1. In Cline, click Settings > Terminal Settings.
  2. Under Default Terminal Profile, select bash from the dropdown.
Bash has the most reliable shell integration support across platforms.
Aggressive terminal reuse can cause commands to run in shells with stale environment state.
  1. In Cline, click Settings > Terminal Settings.
  2. Find Enable aggressive terminal reuse and uncheck it.
If Cline can’t find commands that work in a regular terminal, your shell’s PATH may not be set correctly in the VS Code environment.
  • On macOS, VS Code may not source your full shell profile. Add the necessary paths to your ~/.zshrc or ~/.bashrc, then restart VS Code.
  • On Windows, confirm that the directory containing your tool is included in the system PATH environment variable.
  • On Linux, check that your shell profile (.bashrc, .profile, .zshrc) exports the correct PATH.
After updating your shell profile, open a new terminal in VS Code and verify with:
echo $PATH

Platform-specific fixes

Oh My Zsh can slow down or break shell integration in VS Code. Create a minimal config file for VS Code terminals:
echo 'export TERM=xterm-256color' > ~/.zshrc-vscode
echo 'export PAGER=cat' >> ~/.zshrc-vscode
If issues persist, consider switching the Default Terminal Profile in Cline settings to bash.
PowerShell’s default execution policy may block shell integration scripts. Run the following command as Administrator:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
After applying, restart VS Code and open a new terminal.
When using WSL, follow these steps for reliable shell integration:
  1. Open your project folder from within WSL by running code . in the WSL terminal.
  2. In Cline Settings > Terminal Settings, set Default Terminal Profile to WSL Bash.
  3. Set Shell integration timeout (seconds) to 15 to account for WSL startup time.
Fish shell uses a different syntax than bash or zsh, which can cause compatibility issues with shell integration scripts.
  • Switch the Default Terminal Profile in Cline settings to bash or zsh.
  • Alternatively, switch to background execution mode, which does not rely on shell integration.