I ended up deleting the whole Code folder within the C:\Users\AppData\Roaming.

Note: You have to check the box - view Hidden Files to see these folders within File Explorer.

This solved it.

There must have been some weird corrupted cache issue at the heart of this.

I found this in C:\Users<profile>\AppData\Roaming\Code\logs<datetimestamp>\ptyhost.log

[2022-10-17 07:25:50.695] [ptyhost] [warning] Couldn't get layout info, a terminal was probably disconnected Could not find pty on pty host
[2022-10-17 07:25:54.040] [ptyhost] [warning] Shell integration cannot be enabled for executable "C:\Windows\System32\cmd.exe" and args []
[2022-10-17 07:26:57.939] [ptyhost] [warning] Shell integration cannot be enabled for executable "C:\Windows\System32\cmd.exe" and args []

I think it is related to this.

BTW: I had tried adding a couple of PowerShell VSCode IDE Extensions when things went awry. IIRC they were:

  • PowerShell
  • PowerShell Preview

I had upgraded PowerShell to the latest version 7 too.

$PSVersionTable yielded the following from the respective executables.

Executable Path Version
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe 5.1.17763.1852
C:\Program Files\PowerShell\7\pwsh.exe 7.2.6

Maybe that combo hosed things

Follow up note: Whilst it seemed to have fixed the issue once... soon after the problem manifested itself again. This time I couldn't reset VS Code to a working environment.

  • Then I realised had opened the Project folder in the explorer on the left of the IDE.
  • I had a subfolder that had a PS1 file within that.
  • It didn't have its own .vscode\settings.json
  • When I copied it down from the parent folder, suddenly everything worked again.

.vscode\settings.json just contained this:

{
}

Again this ended up being a one time solution. I ended up back at:

Shell activation failed to activate for cmd.exe

I posted this as a new ticket here

  • In the end I found this to be more of a display issue than anything else!
  • You can actually type cls then hit ENTER, to restore things to the status quo.
  • The Terminal section is black with no prompt to begin with. But you can type in it!!!
  • Perhaps the Prompt is black text on a black background initally, since when you start typing cls, it's quite a way to the right of the left margin.
Answer from JGFMK on Stack Overflow
🌐
Visual Studio Code
code.visualstudio.com › docs › terminal › shell-integration
Terminal Shell Integration
November 3, 2021 - (code --locate-shell-integration-path fish) ... Add the following to your PowerShell profile. Run code $Profile in pwsh to open the file in VS Code. if ($env:TERM_PROGRAM -eq "vscode") { .
🌐
Visual Studio Code
code.visualstudio.com › docs › terminal › basics
Terminal Basics
November 3, 2021 - To create a new terminal, use the ... functionality called shell integration that tracks where commands are run with decorations on the left of a command and in the scrollbar:...
Discussions

VS Code Shell Integration support
# ----------------------------... ZDOTDIR # This variable allows the shell to both detect that VS Code's shell integration is enabled as well # as disable it by unsetting the variable. VSCODE_SHELL_INTEGRATION=1 if [ -f ~/.zshenv ]; then .... More on github.com
🌐 github.com
20
April 4, 2022
What is the best workaround for "Shell integration unavailable"?
I stumbled upon this too what solved it for me was setting to remote signed on the system. Try reloading all modules in VScode and then rebooting your system. I Also have a problem that even though I've added in the instructions to use ; as a delimiter instead of && it loves to use double ampersand every time at least it now recognizes this and uses ; after the first failure. More on reddit.com
🌐 r/roocline
5
3
January 19, 2025
Test: Terminal shell integration
Refs: #133084 macOS @rzhao271 - pwsh, bash linux @roblourens - zsh windows @connor4312 - pwsh Complexity: 5 Authors: @Tyriar, @meganrogge Create Issue The terminal now features "shell integrat... More on github.com
🌐 github.com
7
January 24, 2022
Shell integration failed to activate
Type: Bug Hi, I just downloaded VS Code. When I try and follow the simple get started tutorial I get an error message when I try to run my file. The error message is copied below. Hope you can help Thanks, Ahmed JavaScript Debug Terminal... More on github.com
🌐 github.com
10
April 8, 2023
Top answer
1 of 2
3

I ended up deleting the whole Code folder within the C:\Users\AppData\Roaming.

Note: You have to check the box - view Hidden Files to see these folders within File Explorer.

This solved it.

There must have been some weird corrupted cache issue at the heart of this.

I found this in C:\Users<profile>\AppData\Roaming\Code\logs<datetimestamp>\ptyhost.log

[2022-10-17 07:25:50.695] [ptyhost] [warning] Couldn't get layout info, a terminal was probably disconnected Could not find pty on pty host
[2022-10-17 07:25:54.040] [ptyhost] [warning] Shell integration cannot be enabled for executable "C:\Windows\System32\cmd.exe" and args []
[2022-10-17 07:26:57.939] [ptyhost] [warning] Shell integration cannot be enabled for executable "C:\Windows\System32\cmd.exe" and args []

I think it is related to this.

BTW: I had tried adding a couple of PowerShell VSCode IDE Extensions when things went awry. IIRC they were:

  • PowerShell
  • PowerShell Preview

I had upgraded PowerShell to the latest version 7 too.

$PSVersionTable yielded the following from the respective executables.

Executable Path Version
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe 5.1.17763.1852
C:\Program Files\PowerShell\7\pwsh.exe 7.2.6

Maybe that combo hosed things

Follow up note: Whilst it seemed to have fixed the issue once... soon after the problem manifested itself again. This time I couldn't reset VS Code to a working environment.

  • Then I realised had opened the Project folder in the explorer on the left of the IDE.
  • I had a subfolder that had a PS1 file within that.
  • It didn't have its own .vscode\settings.json
  • When I copied it down from the parent folder, suddenly everything worked again.

.vscode\settings.json just contained this:

{
}

Again this ended up being a one time solution. I ended up back at:

Shell activation failed to activate for cmd.exe

I posted this as a new ticket here

  • In the end I found this to be more of a display issue than anything else!
  • You can actually type cls then hit ENTER, to restore things to the status quo.
  • The Terminal section is black with no prompt to begin with. But you can type in it!!!
  • Perhaps the Prompt is black text on a black background initally, since when you start typing cls, it's quite a way to the right of the left margin.
2 of 2
2

Closing VSCode, verifying that powershell works, then reopening it worked for me.

🌐
GitHub
github.com › microsoft › vscode-docs › blob › main › docs › terminal › shell-integration.md
vscode-docs/docs/terminal/shell-integration.md at main · microsoft/vscode-docs
(code --locate-shell-integration-path fish) ... Add the following to your PowerShell profile. Run code $Profile in pwsh to open the file in VS Code. if ($env:TERM_PROGRAM -eq "vscode") { .
Author   microsoft
🌐
Roo Code
docs.roocode.com › terminal shell integration
Terminal Shell Integration | Roo Code Documentation
February 17, 2026 - (code --locate-shell-integration-path fish) # Or if the above fails for you: # Source the VS Code shell integration script # IMPORTANT: Replace the example path below with the actual path you found in Step 1. # Make sure the path is in a format Cygwin can understand (e.g., using /cygdrive/c/...). # source "/cygdrive/c/Users/YourUser/.vscode/extensions/..../shellIntegration.fish" end
🌐
GitHub
github.com › cline › cline › wiki › Troubleshooting-‐-Shell-Integration-Unavailable
Troubleshooting ‐ Shell Integration Unavailable
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 ...
Author   cline
🌐
GitHub
github.com › romkatv › powerlevel10k › issues › 1827
VS Code Shell Integration support · Issue #1827 · romkatv/powerlevel10k
April 4, 2022 - Hello, and thank you for this fantastic theme ❤️ Visual Studio Code recently introduced shell integration terminal.integrated.shellIntegration which perfectly supports bash, pwsh and zsh. Notice the blue circle before the command line Un...
Author   solid-pixel
Find elsewhere
🌐
Reddit
reddit.com › r/roocline › what is the best workaround for "shell integration unavailable"?
r/roocline on Reddit: What is the best workaround for "Shell integration unavailable"?
January 19, 2025 -

This is what is literally stopping me from using Roo-Cline. On Windows, set the PowerShell security policy to remote signed, set the default profile to PowerShell, updated to the latest vsCode...

Before the AI executes a command, I get an error when it launches the terminal, or tries, and it is trying to use a cwd command to launch it in a folder that doesn't exist.

Using Gemini flash at the moment just to test whether it can execute or see terminal output.

Anybody have any other suggestions to try?

🌐
Danielabaron
danielabaron.me › blog › vscode-shell-integration
VS Code Shell Integration · Daniela Baron
August 23, 2020 - On my computer, it adds a symlink /usr/local/bin/code to the Application folder where the VS Code binary is located. And since /usr/local/bin is in the $PATH environment variable defined in my profile, then typing code in a shell will automatically ...
🌐
GitHub
github.com › microsoft › vscode › issues › 141339
Test: Terminal shell integration · Issue #141339 · microsoft/vscode
January 24, 2022 - The basics of this feature is that it runs a script in your shell of choice and injects invisible sequences at key points to tell the terminal about certain things, like where the prompt, command, output starts and what the current working directory (cwd) is. Shell integration activates by injecting arguments into the profile while it is starting up, you can view these injected arguments by looking for terminalInstance#ctor in a trace log.
Author   Tyriar
🌐
DEV Community
dev.to › jankoweb › vs-code-terminal-shell-integration-windows-4phf
VS Code Terminal Shell Integration (Windows) - DEV Community
February 7, 2026 - To avoid “The terminal is awaiting input” and similar prompts, VS Code needs Terminal Shell Integration enabled and a supported shell.
🌐
GitHub
github.com › microsoft › vscode › issues › 179529
Shell integration failed to activate · Issue #179529 · microsoft/vscode
April 8, 2023 - Command line: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe '-noexit' '-command' 'try { . "c:\Users\ahmed\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\browser\media\shellIntegration.ps1" } catch {}'
Author   ahmedelmahi
🌐
Visual Studio Code
code.visualstudio.com › docs › terminal › profiles
Terminal Profiles
November 3, 2021 - Cmder itself is a terminal, but you can use the Cmder shell in VS Code with the following profile: { "terminal.integrated.profiles.windows": { "cmder": { "path": "C:\\WINDOWS\\System32\\cmd.exe", "args": ["/K", "C:\\cmder\\vendor\\bin\\vscode_init.cmd"] } }, "terminal.integrated.defaultProfile.windows": "cmder" }
🌐
Virtualization Howto
virtualizationhowto.com › forums › vht forums › devops forum
How to Change Integrated Shell in VSCode – DevOps Forum
January 29, 2025 - For advanced configuration options, you can refer to the VS Code documentation on terminal profiles and shell integration.
🌐
GitHub
github.com › microsoft › vscode › issues › 261389
[Bug] Copilot Chat shows "Enable shell integration" warning despite correctly configured shell integration in SSH remote environment · Issue #261389 · microsoft/vscode
August 13, 2025 - # VS Code Shell Integration - Official method if [[ "$TERM_PROGRAM" == "vscode" ]]; then # Load official VS Code script source "$(code --locate-shell-integration-path zsh)" # Force required environment variables export VSCODE_SHELL_INTEGRATION=1 export VSCODE_INJECTION=1 fi
Author   HiriNux
🌐
Visual Studio Code
code.visualstudio.com › docs › terminal › getting-started
Getting started with the terminal
November 3, 2021 - The terminal in VS Code also provides integration with the editor to support features such as links to workspace files and error detection. The terminal can use various shells installed on your machine.
Top answer
1 of 16
704
  1. Install Git from https://git-scm.com/download/win

  2. Open Visual Studio Code and press and hold Ctrl + ` to open the terminal.

  3. Open the command palette using Ctrl + Shift + P.

  4. Type - Select Default Profile

  5. Select Git Bash from the options

  6. Click on the + icon in the terminal window

  7. The new terminal now will be a Git Bash terminal. Give it a few seconds to load Git Bash

  8. You can now toggle between the different terminals as well from the dropdown in terminal.

2 of 16
427

You no longer need to type in bash.exe path manually. This answer is deprecated. Now you can switch to bash directly, if you have git installed in the default path. If you installed git to a different path you need to use the below solution.


Install Git from https://git-scm.com/download/win.

Then open Visual Studio Code and open the command palette using Ctrl + Shift + P. Then type "open user setting", and then select "Open User Settings" from the drop down menu.

Then this tab will open up with default settings on left and your settings on the right:

Now copy this line of code to your own settings page (the pane on the right hand side) and save - "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"

Note: "C:\\Program Files\Git\bin\bash.exe" is the path where the bash.exe file is located from the Git installation. If you are using the Windows Subsystem for Linux (WSL) Bash shell, the path would be "C:\Windows\System32\bash.exe"

Now press Ctrl + ` to open up the terminal from Visual Studio Code. And you will have Bash -

🌐
GitHub
github.com › microsoft › vscode › issues › 156001
Test: Shell integration manual install · Issue #156001 · microsoft/vscode
July 22, 2022 - To workaround this you can manually install shell integration in your init scripts which will activate it even when launched outside VS Code. To test, read the updated documentation at https://github.com/microsoft/vscode-docs/blob/vnext/docs/terminal/shell-integration.md#manual-installation.
Author   Tyriar