feat: zsh as the default shell - #6
Merged
Merged
Conversation
A terminal session execs ${SHELL:-sh}, and nothing set SHELL, so sessions
landed in dash. Publish SHELL, set root's passwd entry, and ship a .zshrc
so zsh-newuser-install does not greet the first interactive session.
/etc/zsh/zprofile is comments only on Ubuntu, so a login zsh never sourced
/etc/profile and had no Nix. The profile hook and its build-time check
close that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sandbox terminal sessions were landing in
sh(dash on Ubuntu) — no history, no completion, no usable prompt.terminal-proxy resolves a SHELL session to
exec /bin/sh -lc 'PATH=/agyn/bin:$PATH exec ${SHELL:-sh}'. Nothing ever setSHELL: the kubelet doesn't, onlylogin/su/sshdwould set it from/etc/passwd, and we exec directly into the container. The image'sSHELL ["/bin/bash", "-lc"]is a build-time directive that changes which shellRUNuses — it produces no runtime env var. So the:-shbranch always won.Changes
zsh(bringszsh-common, so Ubuntu'scompinitand key bindings come along).ENV SHELL=/usr/bin/zsh— the only thing terminal-proxy actually reads.chsh -s /usr/bin/zsh rootso/etc/passwdagrees, for anything arriving vialogin/su./root/.zshrcwith history and prompt defaults. This also suppresseszsh-newuser-install, which fires on an interactive zsh when the user has no rc files — a setup wizard would otherwise greet the first sandbox terminal.emulate sh -c 'source /etc/profile'to/etc/zsh/zprofile. Ubuntu ships that file as comments only, so a login zsh never sourced/etc/profileand had no Nix.RUN zsh -lc 'nix --version && docker --version'keeps that honest at build time.SHELL ["/bin/bash", "-lc"]is left as bash — it's build-time only and child images (devcontainer-agyn,devcontainer-nextjs-demo) inherit it for their ownRUNsteps. Only the misleading comment changed.Verification
Built locally for arm64 and replayed terminal-proxy's exact command chain:
ZSH_VERSION=[5.9],PATH=/agyn/bin:/root/.nix-profile/bin:…,NIX_SSL_CERT_FILEintactgetent passwd root→/usr/bin/zsh;nixanddockerwork under bothbash -lcandzsh -lcFollow-up
devcontainer-agynpinsghcr.io/agynio/devcontainer:sha-8ff09f8and needs an ARG bump to pick this up.devcontainer-nextjs-demotracks:latestand gets it automatically.