vscode-coder icon indicating copy to clipboard operation
vscode-coder copied to clipboard

Optionally open last used folder

Open stirby opened this issue 1 year ago • 2 comments

A customer requested that we add an option to open the last used directory in VSCode, rather than the one configured by the agent.

If VSCode desktop is configured without the folder, it should default to the last-used directory. However, if the coder_agent is given a default directory to use for ssh connections, this will override that behavior.

It would be nice if in the terraform provider we could explicitly enforce opening the last-used directory.

We want to mimic the desktop behavior as closely as possible.

resource "coder_app" "vscode" {
  agent_id     = agent_id
  icon         = "/icon/code.svg"
  slug         = "vscode"
  display_name = "VS Code Desktop"
  order        = var.order
  ...
  open_recent = true # defaults to false
}

stirby avatar Apr 17 '24 22:04 stirby

Good idea

kylecarbs avatar Apr 17 '24 22:04 kylecarbs

This would be huge!

bpmct avatar Apr 23 '24 14:04 bpmct

I added it to the VS Code desktop app module, do note though that it will not affect the builtin VS Code desktop app since we expose no options for configuring that. At least, I think?

Does that seem sufficient or do you think we might need a way to configure this for the built-in app? Or make opening recent the default for the built-in app?

Ideal is to move people to the module if they need configuration, I think.

code-asher avatar May 15 '24 22:05 code-asher

@code-asher that's great. I agree we should direct customers to the registry when possible.

However, the requesting customer can't use our modules (airgapped), so we'd have to support something in the built-in app too. I initially imagined adding a new field under display_apps in coder_agent; I now realize that's not possible.

We should just make opening recent the default for the built-in app.

Ideal behaviour:

  • First connection uses the ssh folder configured in the agent
  • Subsequent connections use last-used folder

Again, rationale is emulating local VSCode.

stirby avatar May 20 '24 19:05 stirby

Sounds good, I will just make it the default! Seems pretty reasonable to me anyway, especially since the built-in has no way to configure a separate folder from the agent.

code-asher avatar May 20 '24 21:05 code-asher