文件历史

提交图

14 次代码提交

作者 SHA1 备注 提交日期
Jarrod Watts 9739abc914 feat(layout): add configurable expanded merge groups (#476)
Co-authored-by: Jarrod Watts <jarrod@Jarrods-MacBook-Pro.local>
2026-04-20 23:52:34 +10:00
Jarrod Watts 7610fde8da feat(git): support wrapped branch display (#474)
Co-authored-by: Jarrod Watts <jarrod@Jarrods-MacBook-Pro.local>
2026-04-20 23:50:27 +10:00
macworld bdac46b257 feat(config): add maxWidth fallback for terminal width detection
When all terminal width detection methods fail (stdout.columns,
stderr.columns, COLUMNS env), the renderer falls back to the
hardcoded UNKNOWN_TERMINAL_WIDTH (40). This new `maxWidth` config
option lets users replace that fallback with a value suited to
their device — useful on mobile clients, piped subprocesses, or
terminals where auto-detection is unreliable.

When the terminal reports a real width, maxWidth is ignored.

Closes #385, closes #404

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 20:49:22 +10:00
kagura-agent 4f2775b2bd fix(stdin): use env var instead of model ID to detect Bedrock provider
getProviderLabel was string-matching `anthropic.claude-` in model IDs,
which false-positived on cross-region IDs like `us.anthropic.claude-sonnet-4-6`.
Now checks `CLAUDE_CODE_USE_BEDROCK=1` env var instead.

Fixes #466

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-20 18:29:58 +10:00
Jarrod Watts 029cca67dd fix: export width override and prefer COLUMNS for HUD layout 2026-04-20 18:23:39 +10:00
墨泪 e74af045ef fix(render): skip width-dependent layout when terminal width is unknown
When running as a CC statusLine subprocess, stdout/stderr are piped and
COLUMNS may not be set. getTerminalWidth() falls back to
UNKNOWN_TERMINAL_WIDTH (40), which is not a real measurement.

Previously, this fallback value was treated as real terminal width in two
places:
- canCombine in renderExpanded(): context + usage lines were always split
  because combined width exceeded 40 columns
- wrapLineToWidth in render(): all output lines were forcefully wrapped
  at 40 characters, breaking the layout

Fix: introduce a widthIsReal guard that checks whether the resolved width
is the UNKNOWN_TERMINAL_WIDTH sentinel. When width is unknown:
- canCombine defaults to true (combine lines optimistically)
- wrapLineToWidth is skipped (wrapWidth=0 → no-op)

The host process (Claude Code) handles final display layout, so wrapping
at an arbitrary fallback value is harmful rather than helpful.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 18:23:39 +10:00
Jarrod Watts 0d331e0ade fix(render): keep compact usage windows labeled on wrap 2026-04-05 10:59:33 +10:00
Jarrod Watts 1d8b1ac491 fix: keep context and usage visible on narrow terminals (#314) (#371) 2026-04-04 15:20:33 +11:00
Jarrod Watts c7ef7520f7 Merge remote-tracking branch 'origin/main' into fix/osc8-visual-length
# Conflicts:
#	tests/render-width.test.js
2026-04-04 14:20:20 +11:00
Jarrod Watts 96a94d0858 fix: cover OSC hyperlink width handling 2026-04-04 14:17:57 +11:00
Jarrod Watts 7ea5f331d9 fix: wrap HUD output when terminal width is unavailable 2026-04-04 13:59:08 +11:00
Jarrod Watts 6c863b2f02 Merge main into i18n branch and keep English default 2026-04-04 13:50:24 +11: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
Jarrod Watts 6ff4212238 fix: prevent HUD rows disappearing in narrow terminals (#159)
* fix(render): handle narrow terminals without dropping rows

* chore: drop dist artifacts from issue-151 PR

* fix(render): preserve multiline activity under narrow widths
2026-03-03 15:26:30 +11:00