Repository navigation
Description
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
vscodedisplay app opens the folder fromdir - 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"
}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 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. - Add a proper way for helper apps (and the VS Code extension) to open in a directory, without the file sync breakage that
dircaused. - Other ideas welcome!
cc @matifali @mafredri — related to the migration-guidance discussion on #507
Generated by Coder Agents
Activity
linear-code commentedon Jul 8, 2026
ENG-3004
mafredri commentedon Jul 9, 2026
I think the deprecation of
diris an opportune moment for us to re-consider how folder selection happens. Here at coder/coder we basically have one template, but we work on multiple projects. Having this folder be defined at the template level makes sense for some apps, but not for others. Take the VS Code Desktop button, for example, as a user I'd love to choose which folder is actually opened up.Some kind of file explorer is one option, another would be automatic project discovery (e.g. find all .git repos in home).
For the VS Code extension, and when connecting through it, we could also utilize the automatic project discovery there to give options when connecting to a workspace.
35C4n0r commentedon Jul 17, 2026
I'm in favour of this, we can add a new params in
coder_app:enable_file_picker&file_picker_output_envUser gets a dropdown arrow on the rightmost side of the app if
enable_file_pickeris enabled where they get a vscode like file picker (we can come up with a better UX)coder commentedon Oct 9, 2026
Closing, since the premise no longer holds:
coder_agent.diris no longer deprecated. The only reason for the deprecation was Coder Desktop file sync, which is now fixed by bundling Mutagen v0.18.5 (macOS v0.8.4+, Windows v0.8.5+). The deprecation and plan-time warning were reverted in #549 and will ship in the next provider release, sodirremains the way to set where helper apps and the VS Code extension open.If the per-user folder picker idea discussed above is still wanted, please open a new issue for it.
Posted on behalf of @matifali