← 教程列表
coding

Fixes

📅 2026/6/12 16:30:02⏱ 约 5 分钟阅读👁 9 阅读

**Windows: Fixed Claude Code 2.1.x hook execution (#331)** Claude Code 2.1.x changed how hooks execute on Windows: it now auto-detects `.sh` files in commands and prepends `bash`. This broke the polyglot wrapper pattern because `bash "run-hook.cmd" session-start.sh` tries to execute the `.cmd` file as a bash script. Fix: hooks.json now calls session-start.sh directly. Claude Code 2.1.x handles the bash invocation automatically. Also added .gitattributes to enforce LF line endings for shell scripts (fixes CRLF issues on Windows checkout). **Windows: SessionStart hook runs async to prevent terminal freeze (#404, #413, #414, #419)** The synchronous SessionStart hook blocked the TUI from entering raw mode on Windows, freezing all keyboard input. Running the hook async prevents the freeze while still injecting superpowers context. **Windows: Fixed O(n^2) `escape_for_json` performance** The character-by-character loop using `${input:$i:1}` was O(n^2) in bash due to substring copy overhead. On Windows Git Bash this took 60+ seconds. Replaced with bash parameter substitution (`${s//old/new}`) which runs each pattern as a single C-level pass — 7x faster on macOS, dramatically faster on Windows. **Codex: Fixed Windows/PowerShell invocation (#285, #243)** - Windows doesn't respect shebangs, so directly invoking the extensionless `superpowers-codex` script triggered an "Open with" dialog. All invocations now prefixed with `node`. - Fixed `~/` path expansion on Windows — PowerShell doesn't expand `~` when passed as an argument to `node`. Changed to `$HOME` which expands correctly in both bash and PowerShell. **Codex: Fixed path resolution in installer** Used `fileURLToPath()` instead of manual URL pathname parsing to correctly handle paths with spaces and special characters on all platforms. **Codex: Fixed stale skills path in writing-skills** Updated `~/.codex/skills/` reference (deprecated) to `~/.agents/skills/` for native discovery.

← 返回教程列表 AI8899 · 内容仅供学习参考