Running terminal commands in Agent mode results in an error (WSL)
Before submitting your bug report
- [x] I believe this is a bug. I'll try to join the Continue Discord for questions
- [x] I'm not able to find an open issue that reports the same bug
- [x] I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: Win11
- Continue version: v1.0.11
- IDE version: 1.95.3
- Model: Claude Sonnet 4
- config:
name: Local Assistant
version: 1.0.0
schema: v1
models:
- name: AWS Claude 4 Sonnet
provider: bedrock
model: us.anthropic.claude-sonnet-4-20250514-v1:0
env:
region: us-east-1
profile: bedrock
capabilities:
- tool_use
roles:
- chat
- edit
- apply
context:
- provider: codebase
- provider: file
- provider: currentFile
- provider: code
- provider: diff
- provider: web
params:
n: 5
- provider: terminal
- provider: problems
- provider: folder
- provider: codebase
OR link to assistant in Continue hub:
Description
Ask in Agent Mode: run python --version
But if I press the upper right button Run, It will be automatically pasted to the terminal below but will not be executed
Pressing Enter will execute correctly
No response
To reproduce
No response
Log output
@KNChiu I am not able to reproduce the issue. It is working properly when I ask "in bash run python --version".
@KNChiu is this still happening for you? I think we might have shipped a fix
I tried it but still got the error. I want to ask if it is because of using wsl ?
WSL feels very plausible. I'm going to update the issue title accordingly and see if other folks have +1s
I've made the following tests:
- 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
I have the same issue trying to run terminal commands in wsl.
I haven't tried installing as a remote extension.
@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.
Just found #5996
I have similar problem caused by using sh instead of zsh to run terminal commands.
#7437 was just merged
I've made the following tests:
- 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.
Version 1.2.4
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.
I have a linux laptop with a VSC remote server connection and the agent also is not able to run commands on remote server.
related https://github.com/continuedev/continue/pull/10786
Fixed by https://github.com/continuedev/continue/pull/10538
Agent commands in WSL are still not working when opening projects in IntelliJ -- I have proposed a change to add support via this PR https://github.com/continuedev/continue/pull/12442