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
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:
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_agentshould 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.
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.
Activity
ethanndickson commentedon May 28, 2025
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 thedisplay_apps
button.vscode://coder.coder-remote[...]
vscode://vscode-remote/ssh-remote+workspace.coder
dir
value ofcoder_agent
. This is done by including it in both URIs.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.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
oncoder_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.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.