Skip to content

Enable choosing which shell is used by opencode VS Code extension #1372

Closed

Description

@mosheduminer

I would like a setting in VS Code to choose what terminal opencode uses to launch.

Currently, the extension seems to use whatever shell is the default one in vscode. For me (on windows) that means it uses powershell right now, but I would like it to use a wsl distribution instead (it's available as an option when I open a new terminal). Using powershell breaks because it doesn't recognize the variable setting syntax (and because opencode is installed in my WSL environment).

I'd also appreciate if you know of a workaround for the meantime.

Activity

  1. assigned and unassigned on Aug 4, 2025
  2. mosheduminer commented on Oct 23, 2025

    @mosheduminer
    Author

    For me personally, this is no longer an issue. With the latest extension release (0.0.12), since the command does not depend on environment variables, I simply have a batch script in a file name opencode.bat on my path:

    bash -c /home/moshe/.opencode/bin/opencode %*

    However, when I try to send text to opencode using ctrl+alt+k, I get a toast saying "fetch failed" (and there terminal doesn't show any change). I'm not sure if I should open a new issue, but this might possibly be related to my opencode setup (using it through wsl)?

  3. rekram1-node commented on Oct 23, 2025

    @rekram1-node
    Collaborator

    hm could you show me the logs?

    if you run:

    opencode debug paths

    it will tell u were logs are kept, if you could send the latest one?

  4. mosheduminer commented on Oct 23, 2025

    @mosheduminer
    Author

    Seems the problem is just the args weren't being forwarded correctly. I added quotes like this:

    bash -c "/home/moshe/.opencode/bin/opencode %*"
    

    and it works now. Thanks!

  5. mosheduminer commented on Oct 23, 2025

    @mosheduminer
    Author

    I could leave this issue open, because technically the issue in the title hasn't been addressed, but I think that it doesn't really need to be addressed since opencode should work regardless of the underlying shell, and my issues have been ironed out. So should the issue be closed?

  6. rekram1-node commented on Oct 23, 2025

    @rekram1-node
    Collaborator

    Up to you, I think if we solved your issue it should be good to close but I dont wanna close it if there is anything actionable to do for you

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions