From 5c3cc888213d8aa3f19aae1b7d63111005311643 Mon Sep 17 00:00:00 2001 From: P Pramod Date: Sat, 5 Sep 2026 04:32:11 +0000 Subject: [PATCH] fix(ssh): build remote container workdir with path.Join The remote workdir is passed to the container's ssh-server via --workdir, so it must always use forward slashes regardless of the client OS. filepath.Join produces backslashes on Windows (e.g. '\\workspaces\\myproject'), which the Linux ssh-server cannot resolve; the session silently falls back to the user's home directory. Verified on a Windows client against an SSH-provider workspace: stock: 'ssh .devpod pwd' -> /home/devpod (wrong dir) patched: -> /workspaces/devpod Refs #972 --- cmd/ssh.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/ssh.go b/cmd/ssh.go index 9083add289..a3c19e913c 100644 --- a/cmd/ssh.go +++ b/cmd/ssh.go @@ -7,7 +7,7 @@ import ( "io" "os" "os/exec" - "path/filepath" + "path" "strings" "time" @@ -495,7 +495,10 @@ func (cmd *SSHCmd) startTunnel(ctx context.Context, devPodConfig *config.Config, } } - workdir := filepath.Join("/workspaces", workspaceClient.Workspace()) + // build the remote workdir with path.Join instead of filepath.Join, + // because the path is used on a Linux container even when devpod + // itself runs on Windows, where filepath.Join would use backslashes + workdir := path.Join("/workspaces", workspaceClient.Workspace()) if cmd.WorkDir != "" { workdir = cmd.WorkDir }