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
{{ message }}
Repository navigation
Running terminal commands in Agent mode results in an error (WSL) #5996
changed the title [-]Running terminal commands in Agent mode results in an error.[/-][+]Running terminal commands in Agent mode results in an error (WSL)[/+]on Jun 25, 2025
Open a project in WSL and tell the agent to run a command, it returns de the following output: run_terminal_command failed with the message: The URL must be of scheme file
Run a command directly on the terminal within WSL, it executes just fine
Open a project in windows and tell the agent to run a command in a windows folder it executes just fine
@uinstinct - I forget, do you have access to a WSL machine? If so thinking this would be a good one to pick up next week if it's actually affecting all WSL folks.
Just chatted with @jpoly1219 who is on WSL and he said he also has been unable to run terminal commands.
I work mostly through WSL, so I fixed it by adding it to the remote.extensionKind setting and force installing the extension in in WSL, but I don't think this is the best solution
Open a project in WSL and tell the agent to run a command, it returns de the following output: run_terminal_command failed with the message: The URL must be of scheme file
Run a command directly on the terminal within WSL, it executes just fine
Open a project in windows and tell the agent to run a command in a windows folder it executes just fine
I have the exact results.
When I explicitly ask if it can run commands, i get this:
I'm sorry, but I can't run shell commands in your environment — the terminal tool available to me has restrictions that prevent it from connecting to your WSL/Docker setup or executing arbitrary commands.
However, I can continue helping by providing the exact commands for you to run, or by making code changes and suggestions.
I experienced the same issue when writing code remotely from my Mac to my Ubuntu desktop, connected through SSH. Telling the model to use bash did not resolve the issue. However, when I am writing code locally on my Mac, the command runs successfully.
It seems that this issue isn't limited to WSL, instead it may fail for any remote connection.
I experienced the same issue when writing code remotely from my Mac to my Ubuntu desktop, connected through SSH. Telling the model to use bash did not resolve the issue. However, when I am writing code locally on my Mac, the command runs successfully.
It seems that this issue isn't limited to WSL, instead it may fail for any remote connection.
I can confirm this, i get the same error when running VS Code on my windows host, but operating in a debian remote ssh environment
Another +1 here: VSCode installed on Windows, talking with LM Studio (installed on Windows), editing code in an Ubuntu WSL directory.
It can edit, create*, and read files just fine. *so long as the parent directory already exists!
But it appears to fail at creating directories or running terminal commands:
The specific errors I got for creating a new file in a new directory:
create_new_file failed with the message: `filepath` argument is required and must not be empty or whitespace-only. (type string)
Please try something else or request further instructions.
Edit: I should also point out that I'm using .zsh instead of the default bash.
Edit again: There exists a potential workaround, as discussed in #8091. I posted my notes here.
The same issue experienced for v 2.0.0 running in VSCode on Windows and the code in WSL and a bit different bug for SSH remote.
The tool run_terminal_command always run at local console of the host where VSCode resides in a case of SSH remote. If the remote is WSL, Continue just put the comand from run_terminal_command into VSCode console line and left there, no "Enter" done. Even manually press Enter, the command output won't capture and AI agent can't see it.
It is a great value of VSCode to do all these remote things, so pity to see these bugs.
Activity
saimadib commentedon Jun 10, 2025
@KNChiu I am not able to reproduce the issue. It is working properly when I ask "in bash run python --version".
Patrick-Erichsen commentedon Jun 24, 2025
@KNChiu is this still happening for you? I think we might have shipped a fix
KNChiu commentedon Jun 25, 2025
I tried it but still got the error. I want to ask if it is because of using wsl ?
Patrick-Erichsen commentedon Jun 25, 2025
WSL feels very plausible. I'm going to update the issue title accordingly and see if other folks have +1s
[-]Running terminal commands in Agent mode results in an error.[/-][+]Running terminal commands in Agent mode results in an error (WSL)[/+]ezeveliz commentedon Aug 7, 2025
I've made the following tests:
run_terminal_command failed with the message: The URL must be of scheme filePatrick-Erichsen commentedon Aug 12, 2025
@uinstinct - I forget, do you have access to a WSL machine? If so thinking this would be a good one to pick up next week if it's actually affecting all WSL folks.
Just chatted with @jpoly1219 who is on WSL and he said he also has been unable to run terminal commands.
ezeveliz commentedon Aug 12, 2025
I work mostly through WSL, so I fixed it by adding it to the remote.extensionKind setting and force installing the extension in in WSL, but I don't think this is the best solution
wbontrager commentedon Aug 17, 2025
I have the same issue trying to run terminal commands in wsl.
I haven't tried installing as a remote extension.
aaceimmrttu commentedon Aug 26, 2025
@ezeveliz What shell are you using? On my mac I'm using zsh, but continue was running commands in sh. So, they had different PATH variables.
aaceimmrttu commentedon Aug 26, 2025
Just found #5996
beng90 commentedon Sep 2, 2025
I have similar problem caused by using
shinstead ofzshto run terminal commands.aaceimmrttu commentedon Sep 2, 2025
#7437 was just merged
tuzumkuru commentedon Sep 24, 2025
I have the exact results.
When I explicitly ask if it can run commands, i get this:
Version 1.2.4
hksquinson commentedon Nov 2, 2025
I experienced the same issue when writing code remotely from my Mac to my Ubuntu desktop, connected through SSH. Telling the model to use bash did not resolve the issue. However, when I am writing code locally on my Mac, the command runs successfully.
It seems that this issue isn't limited to WSL, instead it may fail for any remote connection.
northernpowerhouse commentedon Nov 17, 2025
I can confirm this, i get the same error when running VS Code on my windows host, but operating in a debian remote ssh environment
ad08fee3 commentedon Nov 18, 2025
Another +1 here: VSCode installed on Windows, talking with LM Studio (installed on Windows), editing code in an Ubuntu WSL directory.
It can edit, create*, and read files just fine.
*so long as the parent directory already exists!
But it appears to fail at creating directories or running terminal commands:
The specific errors I got for creating a new file in a new directory:
Edit: I should also point out that I'm using .zsh instead of the default bash.
Edit again: There exists a potential workaround, as discussed in #8091. I posted my notes here.
emilations commentedon Feb 2, 2026
I have a linux laptop with a VSC remote server connection and the agent also is not able to run commands on remote server.
RomneyDa commentedon Mar 24, 2026
related #10786
RomneyDa commentedon Mar 24, 2026
Fixed by #10538
GabeChurch commentedon May 20, 2026
Agent commands in WSL are still not working when opening projects in IntelliJ -- I have proposed a change to add support via this PR #12442
limpidautumn commentedon Jul 12, 2026
Similar issue: "Continue" fails to execute terminal commands when using WSL remote in VSCode.

pavlyuts commentedon Aug 17, 2026
The same issue experienced for v 2.0.0 running in VSCode on Windows and the code in WSL and a bit different bug for SSH remote.
The tool
run_terminal_commandalways run at local console of the host where VSCode resides in a case of SSH remote. If the remote is WSL, Continue just put the comand fromrun_terminal_commandinto VSCode console line and left there, no "Enter" done. Even manually press Enter, the command output won't capture and AI agent can't see it.It is a great value of VSCode to do all these remote things, so pity to see these bugs.