Skip to content

Commit e952a39

Browse files
lghupanclaudejarrodwatts
authored
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 (#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>
1 parent e5d384a commit e952a39

File tree

98 files changed

+41
-3605
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+41
-3605
lines changed

dist/claude-config-dir.d.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

dist/claude-config-dir.d.ts.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/claude-config-dir.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

dist/claude-config-dir.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/config-reader.d.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

dist/config-reader.d.ts.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/config-reader.js

Lines changed: 0 additions & 204 deletions
This file was deleted.

dist/config-reader.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)