Skip to content

Replace the installer's package manager firehose with one line per step - #8

Merged
guilyx merged 1 commit into
mainfrom
feat/sleepy-carson-5qmnnj
Sep 15, 2026
Merged

guilyx merged 1 commit into
mainfrom
feat/sleepy-carson-5qmnnj

Conversation

@guilyx

@guilyx guilyx commented Sep 15, 2026 •

Copy link
Copy Markdown
Owner

What this changes

apt-get update prints about sixty lines of repository chatter — InRelease fetches, byte counts, signature warnings from unrelated third-party repositories. None of it says whether the install is going well, and it buries the lines that do.

Long steps now draw a single line with a spinner and an elapsed counter, replaced by a tick when they finish.

Before

:: updating package lists
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]
Get:3 https://download.docker.com/linux/ubuntu jammy InRelease [48.5 kB]
Err:5 https://cli.github.com/packages stable InRelease
  The following signatures were invalid: EXPKEYSIG 23F3D4EA75716059 ...
... 55 more lines ...
Fetched 9,901 kB in 6s (1,706 kB/s)

After

motionless — vehicle motion cues for Linux

 ✔ python3 3.12
:: System packages (apt): python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-venv pipx
:: installing these needs root, so sudo will ask for your password
 ✔ Refreshing package lists  (6s)
 ✔ Installing 5 system packages  (11s)
 ✔ Installing motionless  (9s)

Nothing is hidden

The output is captured, not discarded. A step that fails prints everything it produced, indented, so the detail arrives exactly when it is wanted:

 ✘ Installing 5 system packages — failed

    Reading package lists...
    E: Unable to locate package gir1.2-gtk-3.0
    E: Package 'python3-gi' has no installation candidate

Without a terminal — piped output, CI logs — it degrades to plain lines with no animation and no escape sequences.

Two things it deliberately does not do

It never wraps something that can prompt. A password prompt drawn over by a spinner is invisible, and that is the failure this installer already shipped once in #6. sudo is primed before any spinner starts, and steps needing root go through a runner that cannot prompt — if the credentials have lapsed it fails immediately and visibly rather than waiting on a prompt nobody can see.

It shows no percentage. Neither apt nor pipx reports progress, so a bar would have to invent one. A fake progress bar is a lie told at the moment the user is deciding whether to trust the thing, so the elapsed counter is the honest version: it conveys "still working, this long so far" without claiming to know the end.

How it was tested

Driven under a real pty with stub sudo, apt-get, pipx and motionless on PATH, and the captured stream replayed through a small renderer that emulates carriage returns, so the final visible state could be checked rather than the raw escape soup:

  • Success: three ticks, elapsed shown only for steps of 3s or more.
  • Failure: apt's real error surfaced, exit status propagated, installer aborts.
  • Piped: plain :: and ✔ lines, no animation.
  • Cursor hidden during the spin and restored on exit, including on interrupt.

shellcheck and bash -n clean.

The failure run earned its keep — it caught a bug in the first draft of the no-prompt runner. sudo -n "$@" || die "sudo credentials expired" folded the credential check into the command, so apt-get exiting 100 was reported as expired sudo credentials. Misattributing a package manager failure to sudo is the same class of misleading error as the CI message I had to rewrite in #7. The check is now separate and the command's own exit status reaches the caller unchanged.

  • shellcheck install.sh and bash -n pass
  • Tested by hand on: real pty and piped, success and failure paths

Checklist

  • New behaviour has tests — shell, so covered by the pty harness above and shellcheck in CI rather than pytest
  • CHANGELOG.md updated under ## [Unreleased]
  • Documentation updated — no user-facing docs describe the installer's output

Notes for review

  • The spinner frames are braille characters. The script already uses ✔, ✘ and —, so UTF-8 was assumed before this.
  • The frame loop sleeps 100 ms, so an install spends a negligible amount of its time drawing.

`apt-get update` prints about sixty lines of repository chatter — InRelease
fetches, signature warnings from unrelated third-party repositories, byte
counts. None of it says whether the install is going well, and it buries the
lines that do.

Long steps now draw a single line with a spinner and an elapsed counter,
replaced by a tick when they finish:

     ✔ Refreshing package lists  (6s)
     ✔ Installing 5 system packages  (11s)
     ✔ Installing motionless  (9s)

The output is captured, not discarded. A step that fails prints everything it
produced, indented, so the detail is there exactly when it is wanted and
absent when it is not. Without a terminal the whole thing degrades to plain
lines with no animation, so piped output and CI logs stay readable.

Two things this deliberately does not do. It never wraps something that can
prompt: a password prompt drawn over by a spinner is invisible, which is the
failure this installer already shipped once. sudo is primed before any spinner
starts, and steps that need root use a runner that cannot prompt. And it shows
no percentage, because neither apt nor pipx reports progress and a bar that
invents one is a lie told at the moment the user is deciding whether to trust
the thing.

Verified under a real pty for the success and failure paths, and piped for the
non-terminal path. The failure run caught a bug in the first draft of the
no-prompt runner: it folded the credential check into the command, so apt
exiting 100 was reported as expired sudo credentials. The two are now checked
separately and the command's own status reaches the caller.
@guilyx
guilyx marked this pull request as ready for review September 15, 2026 08:38
@guilyx
guilyx merged commit e1a7fd2 into main Sep 15, 2026
8 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