Skip to content

fix(login): keep the browser-login note inside the terminal width (v1.56.1) - #196

Merged
paulkr merged 2 commits into
mainfrom
fix/login-note-width
Sep 10, 2026
Merged

fix(login): keep the browser-login note inside the terminal width (v1.56.1)#196
paulkr merged 2 commits into
mainfrom
fix/login-note-width

Conversation

@paulkr

@paulkr paulkr commented Sep 10, 2026

Copy link
Copy Markdown
Member

Summary

one login and one init --auth browser drew a box far wider than the terminal, which the terminal then folded into ragged lines.

The cause is in @clack/prompts: note measures the longest line, pads every line out to it, and draws the border there. It never wraps and never clamps to the window. v1.56.0 put the auth URL inside that box, and the same release grew the URL from about 70 characters to about 330 by adding the install context, so the box became roughly 330 columns wide.

Two changes:

  • The URL prints outside the box, as a bare line. The terminal soft-wraps it, and it stays one unbroken string to copy. A URL is the one thing that must not be hard-wrapped.
  • Everything that stays in the box is hard-wrapped first, via wrapForNote. The URL was the worst offender but not the only one: a deep project path, or the harness list on a machine with several agents installed, would each overflow an 80-column window on their own.

The note's title is shortened too, since clack folds the title into the same width calculation and never wraps it.

Before, on this machine: a 330-column box. After: 75 columns, with the URL on its own line.

◇  This install ──────────────────────────────────────────────────────────╮
│                                                                         │
│  The consent page records this on the key, so you can find the install  │
│  later.                                                                 │
│                                                                         │
│  scope: project                                                         │
│  path: /Users/paul/Documents/One-Development/cli                        │
│  machine: Pauls-MBP.local (darwin 25.2.0, arm64)                        │
│  user: paul                                                             │
│  device: 653043bb-6750-41d8-85ae-d6fa64523c3a                           │
│  launched by: claude-code                                               │
│  cli: 1.56.1                                                            │
│                                                                         │
├─────────────────────────────────────────────────────────────────────────╯

  Opening your browser. If it doesn't open, visit:
https://app.withone.ai/cli/auth?port=60948&state=...

Agent mode is unchanged: it still writes the URL to stderr and never boxes anything.

Also in this PR

  • The platform count reads 750+, in all 14 places it was stated: the help text, the copy-paste agent blurb printed by login and init, one guide, the onboarding copy, skills/one/SKILL.md and the README.
  • The one init banner is the brand lime (#CCFF00) instead of yellow. picocolors has no truecolor helper, so lime() writes the 24-bit escape itself. It is gated on picocolors' own colour detection, so a piped stdout or NO_COLOR still prints the banner plain, and it falls back to green on a terminal that does not advertise truecolor. Verified all three: 10 lime escapes on a truecolor TTY, 0 escapes when piped, green when COLORTERM is unset.

Test plan

  • wrapForNote gains three cases in src/commands/login.test.ts: wrapping at a space, leaving short and blank lines alone, and hard-cutting a run with no space in it so a long path still fits.
  • npm run typecheck and npm run build pass. npm test is 531 passing; the 6 failures are the pre-existing resolveConfig cases in src/lib/config.test.ts that fail on macOS because the temp dir resolves /var vs /private/var. They fail on main too and are untouched here.
  • Ran init --auth browser --project against a sandboxed ONE_HOME and measured the output: every boxed line is 75 columns.

Version bumped to 1.56.1 (patch); the lockfile carries the two version fields only, hand-edited per the repo's lockfile rule.

🤖 Generated with Claude Code

paulkr and others added 2 commits September 10, 2026 14:46
….56.1)

clack's `note` measures the longest line, pads every line to it and draws
the border there. It never wraps and never clamps to the window, so the
auth URL - which grew from ~70 to ~330 characters when the install context
was added - rendered a box wider than the terminal, which then folded into
ragged garbage.

The URL now prints as a bare line outside the box, where the terminal
soft-wraps it and it stays one copy-pasteable string. Everything that does
go in the box is hard-wrapped to the window first, so a deep project path
or a long harness list cannot blow it out either.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The count moves to 750+ everywhere it is stated: help text, the
copy-paste agent blurb, the guide, the onboarding copy, the skill file
and the README.

The `one init` banner was `pc.yellow`; it is now the brand lime
(#CCFF00). picocolors has no truecolor helper, so `lime()` writes the
24-bit escape itself, gated on picocolors' own colour detection so a
piped stdout and NO_COLOR still come out clean, and falling back to
green on a terminal that does not advertise truecolor.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@paulkr
paulkr merged commit 3da81cc into main Sep 10, 2026
7 checks passed
@paulkr
paulkr deleted the fix/login-note-width branch September 10, 2026 19:16
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