> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/cline/cline/llms.txt
> Use this file to discover all available pages before exploring further.

# Terminal quick fixes

> Resolve common terminal integration issues in Cline, including shell integration failures, command capture problems, and PATH issues.

## Try this first: background execution mode

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

<Steps>
  <Step title="Open Cline settings">
    Click **Settings** in the top right corner of the Cline chat panel.
  </Step>

  <Step title="Go to Terminal Settings">
    Select the **Terminal Settings** tab from the left column.
  </Step>

  <Step title="Switch execution mode">
    Set **Terminal Execution Mode** to **Background Exec**.
  </Step>
</Steps>

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.

<AccordionGroup>
  <Accordion title="Shell integration not working">
    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`.
  </Accordion>

  <Accordion title="Commands not being captured">
    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.
  </Accordion>

  <Accordion title="Terminal reuse causing stale state">
    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.
  </Accordion>

  <Accordion title="PATH issues — commands not found">
    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:

    ```bash theme={null}
    echo $PATH
    ```
  </Accordion>
</AccordionGroup>

***

## Platform-specific fixes

<AccordionGroup>
  <Accordion title="macOS with Oh My Zsh">
    Oh My Zsh can slow down or break shell integration in VS Code. Create a minimal config file for VS Code terminals:

    ```bash theme={null}
    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**.
  </Accordion>

  <Accordion title="Windows PowerShell">
    PowerShell's default execution policy may block shell integration scripts. Run the following command as Administrator:

    ```powershell theme={null}
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
    ```

    After applying, restart VS Code and open a new terminal.
  </Accordion>

  <Accordion title="Windows Subsystem for Linux (WSL)">
    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.
  </Accordion>

  <Accordion title="Fish shell">
    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.
  </Accordion>
</AccordionGroup>
