繁體中文

新功能

Windows 的 Claude Code 狀態列終於正常運作

Windows 的 Claude Code 狀態列(statusLine,顯示在終端機最底下的狀態列)終於正常運作。這次修好四處:掛鉤(hook,特定事件發生時被觸發的小程式)優先用全 ASCII 的 Python 路徑;虛擬環境路徑不合就改用系統 PATH,--setup 也會遷移舊指令。五支掛鉤用 UTF-8 讀標準輸入(stdin,程式接收外來資料的入口),轉發器啟動子行程時也固定 UTF-8。Windows 不會再以系統語言的編碼頁誤解工作階段 JSON,將 GitHub專案 這類工作資料夾變成亂碼、寫壞 usage-status.json。沒有 LANG 類環境變數時,改查系統介面語言,和系統匣相同;主控台量實際寬度,寬終端機會重現 (left) 重設時間。像校正列車資訊牌的線路、語言和尺規,班次不再中途消失。非 Windows 不變。

English

FEATURE

Claude Code's status line finally works end-to-end on Windows

On Windows, Claude Code's status line at the bottom of the terminal could fail somewhere along the way. This release fixes four links in that chain. Hooks (small programs triggered by particular events) now avoid Python paths containing non-ASCII characters, and --setup migrates older commands. All five hook scripts now read standard input as UTF-8, so a working-folder name like GitHub專案 is no longer turned into mojibake and prevented from writing usage-status.json. If Windows has no LANG-style environment variable, the hooks now use the system UI language instead. Wide terminals also measure their actual width again, restoring the (left) reset-time suffix. It is like repairing the wiring, language setting, and ruler behind a train-information board so its timetable does not vanish mid-journey. Non-Windows behavior is unchanged.

原始 CHANGELOG

Original changelogWindows 的 Claude Code 狀態列終於正常運作
**The Claude Code statusLine hook now works end-to-end on Windows**: four fixes land together. `setup_hook` now prefers an all-ASCII `python.exe` path (falling back to system PATH when the venv path isn't ASCII), since Claude Code on Windows fails to spawn statusLine commands whose path contains non-ASCII characters; `--setup` migrates existing non-ASCII commands. All five hook scripts now read stdin via `sys.stdin.buffer` and decode UTF-8 explicitly (and the forwarder pins `encoding=utf-8` on its subprocess fan-out), since Windows otherwise decodes the piped session JSON with the locale codepage, turning a cwd like `GitHub專案` into mojibake and silently breaking `usage-status.json` writes. Hooks now fall back to `GetUserDefaultUILanguage` when no `LANG`-style env var is set (the Windows norm), matching the tray's existing language detection. `get_width()` now probes the real console width via `CONOUT$` + `GetConsoleScreenBufferInfo` instead of always falling back to a fixed 116 columns, restoring the `(left)` reset-time suffix on wide terminals. Non-Windows behavior is unchanged.