Commit Graph

7 Commits

Author SHA1 Message Date
github-actions[bot]
db7ea25186 build: compile dist/ [auto] 2026-03-20 00:42:28 +00:00
Pan Hu
e952a399f1 fix: stop terminal scrolling to top on tool execution (#248)
* fix: detect terminal width via stderr when stdout is piped

When Claude Code runs the statusLine as a subprocess, stdout is captured
(piped), so process.stdout.columns is undefined. With no terminal width,
long lines aren't wrapped by the HUD — the terminal wraps them silently
instead. Claude Code counts \n characters to determine how many lines to
erase on the next render, so the physical line count diverges from what
Claude Code expects. Over successive renders the cursor drifts upward into
the scrollback buffer, causing the terminal to jump to the top on every
tool execution (https://github.com/jarrodwatts/claude-hud/issues/209).

Fix: fall back to process.stderr.columns before the COLUMNS env var.
When the statusLine subprocess is spawned, only stdout is redirected;
stderr remains connected to the real TTY and returns the correct width.
With accurate width, lines are properly wrapped in the HUD output and
Claude Code's line count stays consistent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: drop dist artifacts and cover stderr width

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
2026-03-20 11:41:51 +11:00
github-actions[bot]
75128e8624 build: compile dist/ [auto] 2026-01-13 23:55:46 +00:00
github-actions[bot]
e372132a02 build: compile dist/ [auto] 2026-01-07 05:00:50 +00:00
github-actions[bot]
756912c26a build: compile dist/ [auto] 2026-01-05 04:06:24 +00:00
Jarrod Watts
db9e275c5d chore: remove dist/ from git tracking
dist/ was already in .gitignore but was still tracked because it was
added before the gitignore entry. This removes it from the index so
.gitignore takes effect.

After this:
- PRs will no longer include dist/ changes
- CI workflow rebuilds dist/ on main after each merge
- Contributors run `npm run build` locally to test

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 14:52:20 +11:00
github-actions[bot]
b59e5daacd build: compile dist/ [auto] 2026-01-05 03:37:58 +00:00