usage

usage 0.28.9

工具與目錄
在這頁

新功能 1 項

01

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 不變。

官方原文

**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.