Skip to content

fix(install): collapse the download meter to a single blue progress line - #133

Merged
sosidudku1 merged 1 commit into
mainfrom
valeryb/install-single-line-progress
Aug 18, 2026
Merged

fix(install): collapse the download meter to a single blue progress line#133
sosidudku1 merged 1 commit into
mainfrom
valeryb/install-single-line-progress

Conversation

@plombeer31

Copy link
Copy Markdown
Collaborator

What

Installing the CLI currently prints curl's default transfer meter — a three-line table, twice
(once for the tarball, once for the checksum):

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 47.5M  100 47.5M    0     0  4372k      0  0:00:11  0:00:11 --:--:-- 5142k

This replaces it with a single line that stays on one line, in the project's own accent blue:

downloading atomic-agent  ████████████░░░░  76%  36.1 MB of 47.5 MB

How

  • Both fetchers are silenced (curl -fsS -L, wget -q) and run in the background; the
    progress line is drawn from the growing output file against Content-Length, redrawn with
    \r + \033[K, and terminated by exactly one newline.
  • The checksum file (99 bytes) downloads silently — no bar for a file that finishes instantly.
  • Colour is #0b63f6, matching the badges in the README: 24-bit when COLORTERM advertises
    truecolor, 256-colour otherwise.

Degradation

Condition Behaviour
Not a TTY (CI, | tee) one plain line, no bar, no escape codes
NO_COLOR set, or TERM=dumb bar kept, colour dropped
Non-UTF-8 locale #/- instead of /
No Content-Length (chunked) byte counter only, no percentage
wget instead of curl same line, byte counter only

Bar width adapts to the terminal (24 / 16 / 8 blocks) so the line never wraps — a wrapped
line would smear across redraws. Width is read via stty size <&3, because inside the
command substitution that captures it fd 1 is the pipe, not the terminal, and tput cols
reports the terminfo default of 80 regardless of the real window.

Failure handling is unchanged

A failed transfer still aborts the install with curl's exit status; the progress line is
cleared first and the failing URL is printed. Checksum verification, the codesign check, and
the atomic binary/directory replacement are all untouched.

Testing

Verified on macOS arm64 against the real v0.2.1 release (47.5 MB):

  • one line, 260 in-place redraws, zero newlines emitted during the download
  • terminal widths 120 / 100 / 80 / 64 — bar 24 / 24 / 16 / 8, line always fits
  • NO_COLOR=1, TERM=dumb, LANG=C, and piped-to-cat paths each checked
  • full install verified end to end: checksum OK, 141 MB binary in place, binary runs
  • failure path: ATOMIC_AGENT_VERSION=v0.0.0-does-not-exist exits non-zero, prints the URL,
    installs nothing

scripts/install.ps1 is untouched; the Windows meter is a separate change.

@sosidudku1
sosidudku1 merged commit 8cc33c3 into main Aug 18, 2026
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.

2 participants