Problem
dir on coder_agent was deprecated in #507 (to avoid breaking Coder Desktop file sync). But dir was also how templates controlled where the helper apps open:
- the built-in
vscode display app opens the folder from dir
- the web terminal starts sessions in
dir
With dir deprecated, there's no first-class replacement for either. A community member flagged this — most of their users only ever interact with the directory their code is cloned into.
Workarounds today
VS Code Desktop: hide vscode in display_apps and use the vscode-desktop module with folder:
resource "coder_agent" "main" {
os = "linux"
arch = "amd64"
display_apps {
vscode = false
}
}
module "vscode" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/vscode-desktop/coder"
version = "1.2.1"
agent_id = coder_agent.main.id
folder = "/home/coder/project"
}
⚠️ This only works via the dashboard button. If users open the workspace directly from the VS Code extension sidebar (which is how the community member expects it to work, and how many of our own engineers connect), the extension reads the agent's expanded directory — i.e. dir — so there's no workaround at all for that path.
Web terminal: hide web_terminal in display_apps and add a coder_app with a command that cd's first:
resource "coder_agent" "main" {
os = "linux"
arch = "amd64"
display_apps {
vscode = false
web_terminal = false
}
}
resource "coder_app" "terminal" {
agent_id = coder_agent.main.id
slug = "terminal"
display_name = "Terminal"
icon = "/icon/terminal.svg"
command = "cd /home/coder/project && exec $SHELL"
}
Neither is obvious, and neither is documented as the migration path.
Suggestion
- Document this better — e.g. discourage use of the helper apps and point to
coder_app / registry modules with explicit folder/command properties. Not ideal on its own though: people connecting directly from the VS Code extension never touch the dashboard buttons, so better docs don't help them at all.
- Add a proper way for helper apps (and the VS Code extension) to open in a directory, without the file sync breakage that
dir caused.
- Other ideas welcome!
cc @matifali @mafredri — related to the migration-guidance discussion on #507
Generated by Coder Agents
Problem
dironcoder_agentwas deprecated in #507 (to avoid breaking Coder Desktop file sync). Butdirwas also how templates controlled where the helper apps open:vscodedisplay app opens the folder fromdirdirWith
dirdeprecated, there's no first-class replacement for either. A community member flagged this — most of their users only ever interact with the directory their code is cloned into.Workarounds today
VS Code Desktop: hide
vscodeindisplay_appsand use the vscode-desktop module withfolder:dir— so there's no workaround at all for that path.Web terminal: hide
web_terminalindisplay_appsand add acoder_appwith acommandthat cd's first:Neither is obvious, and neither is documented as the migration path.
Suggestion
coder_app/ registry modules with explicitfolder/commandproperties. Not ideal on its own though: people connecting directly from the VS Code extension never touch the dashboard buttons, so better docs don't help them at all.dircaused.cc @matifali @mafredri — related to the migration-guidance discussion on #507