Skip to content

Running terminal commands in Agent mode results in an error (WSL) #5996

Open

Description

@KNChiu

Before submitting your bug report

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
Image

But if I press the upper right button Run, It will be automatically pasted to the terminal below but will not be executed
Image

Pressing Enter will execute correctly
Image

No response

To reproduce

No response

Log output

Activity

  1. added
    kind:bugIndicates an unexpected problem or unintended behavior
    on Jun 5, 2025
  2. saimadib commented on Jun 10, 2025

    @saimadib
    Contributor

    @KNChiu I am not able to reproduce the issue. It is working properly when I ask "in bash run python --version".

    Image

  3. Patrick-Erichsen commented on Jun 24, 2025

    @Patrick-Erichsen
    Contributor

    @KNChiu is this still happening for you? I think we might have shipped a fix

  4. KNChiu commented on Jun 25, 2025

    @KNChiu
    Author

    I tried it but still got the error. I want to ask if it is because of using wsl ?

    Image

  5. Patrick-Erichsen commented on Jun 25, 2025

    @Patrick-Erichsen
    Contributor

    WSL feels very plausible. I'm going to update the issue title accordingly and see if other folks have +1s

  6. 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
  7. ezeveliz commented on Aug 7, 2025

    @ezeveliz

    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
  8. Patrick-Erichsen commented on Aug 12, 2025

    @Patrick-Erichsen
    Contributor

    @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.

  9. ezeveliz commented on Aug 12, 2025

    @ezeveliz

    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

  10. wbontrager commented on Aug 17, 2025

    @wbontrager

    I have the same issue trying to run terminal commands in wsl.

    I haven't tried installing as a remote extension.

  11. aaceimmrttu commented on Aug 26, 2025

    @aaceimmrttu

    @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.

  12. aaceimmrttu commented on Aug 26, 2025

    @aaceimmrttu

    Just found #5996

  13. beng90 commented on Sep 2, 2025

    @beng90

    I have similar problem caused by using sh instead of zsh to run terminal commands.

  14. aaceimmrttu commented on Sep 2, 2025

    @aaceimmrttu

    #7437 was just merged

  15. tuzumkuru commented on Sep 24, 2025

    @tuzumkuru

    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

  16. hksquinson commented on Nov 2, 2025

    @hksquinson

    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.

  17. northernpowerhouse commented on Nov 17, 2025

    @northernpowerhouse

    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

  18. ad08fee3 commented on Nov 18, 2025

    @ad08fee3

    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:

    Image

    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.

  19. emilations commented on Feb 2, 2026

    @emilations

    I have a linux laptop with a VSC remote server connection and the agent also is not able to run commands on remote server.

  20. RomneyDa commented on Mar 24, 2026

    @RomneyDa
    Contributor

    related #10786

  21. RomneyDa commented on Mar 24, 2026

    @RomneyDa
    Contributor

    Fixed by #10538

  22. GabeChurch commented on May 20, 2026

    @GabeChurch

    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

  23. limpidautumn commented on Jul 12, 2026

    @limpidautumn

    Similar issue: "Continue" fails to execute terminal commands when using WSL remote in VSCode.
    Image

  24. pavlyuts commented on Aug 17, 2026

    @pavlyuts

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:context-providersRelates to context providerskind:bugIndicates an unexpected problem or unintended behavior

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions