Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion cmd/devcontainer/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,23 @@ func newExecCmd(rf *rootFlags) *cobra.Command {
}
defer restore()

// Default cwd to the resolved container workspace folder
// when --working-dir wasn't given, so `devcontainer exec ls`
// lands inside the project rather than wherever the base
// image's WORKDIR points.
wd := workingDir
if wd == "" {
wd = cfg.ContainerWorkspaceFolder
}

// NOTE: window-size forwarding (SIGWINCH → resize) is not
// wired here yet — the runtime ExecOptions surface for it
// is still in-flight on main. Once it lands we can plumb
// term.GetSize + signal.Notify(SIGWINCH) through.
res, err := eng.Exec(ctx, workspace, devcontainer.ExecOptions{
Cmd: args,
User: user,
WorkingDir: workingDir,
WorkingDir: wd,
Tty: tty,
Stdin: os.Stdin,
Stdout: os.Stdout,
Expand Down
Loading