Skip to content

Put mise shims and Go/Cargo bins on PATH in login shells - #40

Merged
bmorton merged 1 commit into
mainfrom
bmorton/fix-login-shell-path
Oct 30, 2026
Merged

bmorton merged 1 commit into
mainfrom
bmorton/fix-login-shell-path

Conversation

@bmorton

@bmorton bmorton commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Problem

After #39, a fresh Coder workspace reported tmux: command not found and go: command not found over coder ssh.

Debian's /etc/profile resets PATH for login shells, and the base image's /etc/profile.d/00-restore-env.sh only restores the PATH that existed when the base image was built. The ENV PATH added by our Dockerfile therefore vanished in every login shell (coder ssh, VS Code terminals, new tmux windows). CI didn't catch it because envbuilder's init script is a non-login shell that inherits the image ENV directly. The old devcontainer features avoided the problem by patching the shell rc files.

Fix

  • Add /etc/profile.d/10-devcontainer-tools.sh (shipped as .devcontainer/10-devcontainer-tools.sh), which exports the mise variables and prepends the cargo, Go and mise shims directories idempotently, and source it from /etc/bash.bashrc and /etc/zsh/zshrc.
  • verify-devcontainer.sh now also checks that tmux, go and mise resolve from bash -l and zsh -l, so the envbuilder CI job fails if this regresses.

Workaround for an already-running workspace

export PATH=/usr/local/share/mise/shims:/go/bin:/usr/local/cargo/bin:$PATH

🤖 Generated with Claude Code

https://claude.ai/code/session_01AihTX41wWUjfBk3c2A9h2Z

Debian's /etc/profile resets PATH for login shells and the base image's
00-restore-env.sh only restores the PATH it saw at base-image build time, so
the ENV PATH added by this Dockerfile disappeared in `coder ssh`, VS Code
terminals and tmux windows ("tmux: command not found", "go: command not
found") even though CI's non-login init script saw everything.

Install /etc/profile.d/10-devcontainer-tools.sh (exports the mise variables and
prepends the tool dirs idempotently) and source it from /etc/bash.bashrc and
/etc/zsh/zshrc, as the devcontainer features used to do. The verify script now
also checks tool visibility from bash -l and zsh -l so this cannot regress
silently.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AihTX41wWUjfBk3c2A9h2Z
@bmorton
bmorton merged commit 85ce751 into main Oct 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant