Skip to content

Minimal reproducible environment for reporting VSCode 1.93+ Shell Integration problems

License

Notifications You must be signed in to change notification settings

suinplayground/shell-integration-problems

 
 

Repository files navigation

Shell Integration Problems

This repository provides a minimal reproducible environment to help report issues with VSCode 1.93's new Terminal Shell Integration API. It aims to assist the VSCode team in improving the API, and was created for users of the Claude Dev extension experiencing shell integration problems ("Shell Integration Unavailable" error, no output streamed back to extension, etc.).

  1. Prerequisite: Basic Shell Integration Troubleshooting
  2. Reproducing Shell Integration Problems with This Extension
  3. Observing Results and Submitting a Report

1. Prerequisite: Basic Shell Integration Troubleshooting

Before using this extension to report an issue, ensure that you have properly tried to set up shell integration:

  1. Update VSCode to the latest version:
    • Open the Command Palette (Cmd+Shift+P on Mac, Ctrl+Shift+P on Windows/Linux)
    • Type "Check for Updates" and install any available updates
  2. Configure VSCode to use a supported shell (zsh, bash, fish, or PowerShell):
    • Open the Command Palette
    • Type "Terminal: Select Default Profile" and select one of the supported shells
  3. Remove any shell customization frameworks like Powerlevel10k or Oh My Zsh (not to be confused with zsh, Oh My Zsh is an add-on to zsh)
    • 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
      
  4. Restart VSCode and try the shell integration again.

If you're still experiencing issues, try the following additional steps:

  1. For Windows PowerShell users:

    • Ensure you're using PowerShell v7+:
      • Check your current PowerShell version by running: $PSVersionTable.PSVersion
      • If your version is below 7, update PowerShell.
    • Check and update your execution policy if necessary:
      • 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: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser.
      • Confirm the Change by typing Y and pressing Enter when prompted.
      • Verify the Policy Change by running Get-ExecutionPolicy again to confirm the new setting.
      • Restart VSCode and try the shell integration again.
  2. If you're still experiencing issues with shell integration not being available, you can try manually installing shell integration.

    For example, if you use zsh:

    • Run code ~/.zshrc in the terminal to open your zsh configuration file, and add the following line:
      [[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path zsh)"
      
    • Save the file, restart VSCode, and try the shell integration again.

    If you use PowerShell:

    • Run code $Profile in the terminal to open your PowerShell profile, and add the following line:
      if ($env:TERM_PROGRAM -eq "vscode") { . "$(code --locate-shell-integration-path pwsh)" }
      
    • Save the file, restart VSCode, and try the shell integration again.

2. Reproducing Shell Integration Problems with This Extension

  1. Clone this repository:
    git clone https://github.com/saoudrizwan/shell-integration-problems.git
    
  2. Install the necessary dependencies:
    cd shell-integration-problems
    npm install
    
  3. Open the cloned repository in VSCode.
  4. Press F5 to run the extension in a new debugger window.

The extension provides a command you can access through the Command Palette (Cmd+Shift+P on Mac, Ctrl+Shift+P on Windows/Linux):

shell-integration-problems: Run in Terminal

Selecting this command will prompt you to enter a shell command. The extension will attempt to execute the command in a terminal using shell integration, and the output will be logged in the primary window's Debug Console.

If your command is specific to your original project where you used Claude Dev:

  1. In the debugger window, open the Command Palette.
  2. Select "File: Open Folder" and choose your original project folder.
  3. Use shell-integration-problems: Run in Terminal for project-specific commands.

3. Observing Results and Submitting a Report

  1. Open the Debug Console in the primary window to see console logs.

  2. Run the commands in the debugger window and observe the output in the Debug Console. Note that the "Read chunk" data will contain raw terminal output. For example, you might see:

    • Escape characters: \x1B or \033
    • ANSI color codes: \x1B[31m (red text)
    • Command sequences: \x1B]633;C\x07 (shell integration markers)

    These raw outputs are typically parsed and stripped out by extensions like Claude Dev, which is why you wouldn't see them in the processed output. In this debugging context, however, seeing the raw output is useful for diagnosing shell integration issues.

  3. After reproducing the issue, right-click in the Debug Console and select "Copy All" to copy all logs.

Debug Console Screenshot

  1. Go to the Report Shell Integration Problem page.
  2. Fill out the issue form with the following information:
    • Problem: Provide a clear description of the problem you're experiencing.
    • Debug Console Logs: Paste the console logs from the Debug Console.

Your report will help improve the Shell Integration API and the Claude Dev extension. Thank you for your help!

About

Minimal reproducible environment for reporting VSCode 1.93+ Shell Integration problems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%