Skip to content

Rootfs: Restore the bash login shell so demo tab-completion works - #1317

Merged
brandonpayton merged 1 commit into
mainfrom
brandonpayton/restore-bash-login-shell
Aug 26, 2026
Merged

Rootfs: Restore the bash login shell so demo tab-completion works#1317
brandonpayton merged 1 commit into
mainfrom
brandonpayton/restore-bash-login-shell

Conversation

@brandonpayton

Copy link
Copy Markdown
Member

Why

Interactive tab auto-completion in the browser demo shell stopped working.
Bash provides that completion through readline; dash does not. PR #1307
("Boot login from package-backed images") changed the main-shell demo boot
from launching bash directly to booting through login:

before: argv = ["bash", "-l", "-i"] # interactive bash
after: argv = ["/usr/bin/login", "-p", "-f", "maker"]

login -f maker execs the maker account's login shell from
images/rootfs/etc/passwd, which was /bin/sh -- and /bin/sh is a dash
alias (see images/rootfs/PACKAGES.toml). So the demo silently went from an
interactive bash shell (with completion) to dash (with none).

What changed

Set the maker account's login shell to /bin/bash in
images/rootfs/etc/passwd. Bash already ships in the image
(images/rootfs/PACKAGES.toml maps /usr/bin/bash with a /bin/bash alias, and
build-source-rootfs-shell-image.ts requires those aliases), so
login -f maker now execs an interactive login bash and completion
returns. Root keeps /bin/sh.

Update the two host tests that assert the maker record against the real
images/rootfs/etc/passwd -- getpwent.test.ts (the getpwent probe) and
demo-login-image.test.ts (the "canonical rootfs data is truthful" guard) --
to expect /bin/bash for maker. The demo-login fixture cases that pass an
explicit /bin/sh to configureDemoLogin are unchanged; they exercise that
helper's shell parameter, not the shipped passwd.

Validation

The changed assertions are string-consistent with the edited passwd by
construction (getpwent deterministically echoes the passwd shell field).
Full browser verification of interactive tab-completion requires booting
the rebuilt shell image; the host tests above are the automated guard and
run in CI.

🤖 Generated with Claude Code

## Why

Interactive tab auto-completion in the browser demo shell stopped working.
Bash provides that completion through readline; dash does not. PR #1307
("Boot login from package-backed images") changed the main-shell demo boot
from launching bash directly to booting through `login`:

  before: argv = ["bash", "-l", "-i"]           # interactive bash
  after:  argv = ["/usr/bin/login", "-p", "-f", "maker"]

`login -f maker` execs the maker account's login shell from
images/rootfs/etc/passwd, which was `/bin/sh` -- and `/bin/sh` is a dash
alias (see images/rootfs/PACKAGES.toml). So the demo silently went from an
interactive bash shell (with completion) to dash (with none).

## What changed

Set the maker account's login shell to `/bin/bash` in
images/rootfs/etc/passwd. Bash already ships in the image
(images/rootfs/PACKAGES.toml maps /usr/bin/bash with a /bin/bash alias, and
build-source-rootfs-shell-image.ts requires those aliases), so
`login -f maker` now execs an interactive login bash and completion
returns. Root keeps `/bin/sh`.

Update the two host tests that assert the maker record against the real
images/rootfs/etc/passwd -- getpwent.test.ts (the getpwent probe) and
demo-login-image.test.ts (the "canonical rootfs data is truthful" guard) --
to expect `/bin/bash` for maker. The demo-login fixture cases that pass an
explicit `/bin/sh` to configureDemoLogin are unchanged; they exercise that
helper's shell parameter, not the shipped passwd.

## Validation

The changed assertions are string-consistent with the edited passwd by
construction (getpwent deterministically echoes the passwd shell field).
Full browser verification of interactive tab-completion requires booting
the rebuilt shell image; the host tests above are the automated guard and
run in CI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@brandonpayton
brandonpayton merged commit 03f8544 into main Aug 26, 2026
@brandonpayton
brandonpayton deleted the brandonpayton/restore-bash-login-shell branch August 26, 2026 04:56
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