Skip to content

Fix bar::units-shell / bar::lx-shell on hosts without script(1) - #63

Open
keithharvey wants to merge 1 commit into
beyond-all-reason:masterfrom
keithharvey:fix-units-shell-script-dep
Open

Fix bar::units-shell / bar::lx-shell on hosts without script(1)#63
keithharvey wants to merge 1 commit into
beyond-all-reason:masterfrom
keithharvey:fix-units-shell-script-dep

Conversation

@keithharvey

@keithharvey keithharvey commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Problem

just bar::units-shell and just bar::lx-shell fail immediately on some hosts:

scripts/common.sh: line 250: exec: script: not found
error: recipe `units-shell` failed with exit code 127

distrobox_exec_interactive wrapped distrobox enter in script -qec to force a PTY. Fedora ships script(1) in a separate util-linux-script subpackage rather than in util-linux, and image-based distros don't necessarily include it. Bazzite 44 doesn't, so both recipes are unusable there and there's no clean way to layer a package in just to get them back.

Worth noting the container side is unaffected — fedora:43 (our dev.Containerfile base) does pull in util-linux-script, so script exists inside bar-dev but not outside it. The failure is purely host-side.

Fix

Drop the wrapper and call distrobox enter directly.

The PTY wrapper was never load-bearing. A just recipe inherits the caller's terminal on both stdin and stdout, and distrobox-enter allocates a tty itself — it only falls back to headless when it finds neither (if [ ! -t 0 ] || [ ! -t 1 ]). Wrapping it in script just added a host dependency to get a tty that was already there.

Calling it directly also removes the printf %q quoting loop, which existed only because script parses its argument through /bin/sh. Passing argv straight through needs no quoting.

Verification

On Bazzite 44 (host has no script(1)), driving just bar::units-shell under a real pty:

[ok]    Entering lx test shell (busted on PATH).
...
❯ which busted && busted --version
~/code/Beyond-All-Reason/.lux/5.1/test_dependencies/5.1/bin/busted
2.2.0

Confirmed separately that a just recipe sees STDIN_TTY / STDOUT_TTY, and that distrobox enter under a pty passes the tty through to the command (tty reports /dev/pts/0, test -t 0 succeeds).

just doctor clean, 23 passed.

image

LLM Disclosure

Diagnosed and drafted with Claude Code; reviewed and verified by me on the affected host.

bar::units-shell and bar::lx-shell died with

  scripts/common.sh: line 250: exec: script: not found

on hosts without script(1). Fedora ships it in a separate
util-linux-script subpackage, and image-based distros don't
necessarily pull that in -- Bazzite 44 doesn't, so both
recipes were unusable there.

The wrapper isn't needed. A just recipe inherits the caller's
terminal on stdin and stdout, and distrobox enter allocates a
tty itself unless it finds neither. Calling it directly also
drops the printf %q dance, which only existed because script
parses its argument through /bin/sh.
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