Skip to content

VSCode link connects you to the root filesystem of the target workspace #168

Open
@diranged

Description

@diranged

The Web UI link for VSCode Desktop links you properly into your /home/coder/<repo> workspace path .. however, the new Desktop UI link (cool) opens VSCode into the / path on the target host:

Image

Activity

ethanndickson

ethanndickson commented on May 28, 2025

@ethanndickson
Member

Few things to note here, but I'm gonna assume you're not using an explicit coder_app for the VSCode Desktop button (or the VSCode Desktop module) and are just relying on the display_apps button.

  • The Web UI opens the URI for the Coder VSCode extension vscode://coder.coder-remote[...]
  • Coder Desktop uses the VSCode remote URI, e.g. vscode://vscode-remote/ssh-remote+workspace.coder
  • In both cases, VSCode is opened with the directory defaulting to the dir value of coder_agent. This is done by including it in both URIs.
  • If coder_agent.dir is unset, the Coder VSCode extension will open the last opened directory for that workspace, or leave you in a 'connected but no directories open' state.
  • If coder_agent.dir is unset, the VSCode Remote extension (when invoked via the URI Coder Desktop constructs) would appear to default to root 😕.
    I guess it's ambiguous whether vscode://vscode-remote/ssh-remote+workspace.coder/ should connect to no directory or the root directory on Linux.

Once we close out #156, we'll require the Coder VSCode extension be used, and the 'last opened directory' behavior will be consistent.
In the meantime, as a workaround, setting dir on coder_agent should get you the desired behavior. This is what we have on our template and what I tested with, but let me know if you have any issues.

Image
It also looks like the Defaults to "$HOME". part on the Terraform provider documentation is evidently not true, so I'll also look into what's going on there.

Also, thank you for finding and reporting these issues you're encountering! We really appreciate it.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @diranged@ethanndickson

        Issue actions

          VSCode link connects you to the root filesystem of the target workspace · Issue #168 · coder/coder-desktop-macos