Skip to content

devpod ssh should default to devcontainer workspaceFolder #516

@davzucky

Description

@davzucky

Problem

When connecting with devpod ssh without --workdir, the session starts in /workspaces/<workspace-id> instead of the resolved devcontainer workspaceFolder.

Expected behavior

devpod ssh should default to mergedConfig.WorkspaceFolder when available, and only fall back to /workspaces/<workspace-id> when it cannot be resolved.

Current behavior

In cmd/ssh.go, the default workdir is hardcoded to filepath.Join("/workspaces", workspaceClient.Workspace()) unless --workdir is explicitly passed.

Proposed fix

Resolve default workdir in this order:

  1. --workdir flag
  2. result.MergedConfig.WorkspaceFolder from workspace result
  3. fallback /workspaces/<workspace-id>

This aligns direct devpod ssh behavior with devcontainer semantics.


*edited to fix formatting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions