diff options
| author | Jesse Vincent <jesse@fsck.com> | 2026-07-16 00:13:35 +0000 |
|---|---|---|
| committer | Drew Ritter <drew@ritter.dev> | 2026-07-23 17:27:16 -0700 |
| commit | 5151e7aebece23c77545df8af6b9902f9fda7364 (patch) | |
| tree | a19209616383b638a744ab71701a5437425667a7 /scripts/package-codex-plugin.sh | |
| parent | 2dbbaed081a5caee0573d992b2c73b586a7d5dc3 (diff) | |
fix(hooks): dispatch the SessionStart hook via Git Bash on Windows
The SessionStart command string starts with a quoted path, which breaks
both Windows shells Claude Code may hand it to: PowerShell parses the
leading quoted string as an expression and dies on the next bareword
('Unexpected token session-start', #1751), and cmd.exe's /c quote rule
drops the outer quotes when the path contains a metacharacter, so a
profile dir like C:\Users\Name(External) truncates the command at the
'(' (#1918). Either way the bootstrap silently never loads.
Declare shell: "bash" on the hook. Claude Code >= 2.1.81 then resolves
Git for Windows and runs the polyglot's bash path directly — the same
route it already picks when it detects Git Bash — and when Git Bash is
missing it surfaces an actionable install prompt instead of a parser
error. Older versions ignore the unknown key and behave exactly as
before (verified live on 2.0.77 and 2.1.80).
Verified end-to-end with real claude sessions: Linux (hook fires,
bootstrap injected), Windows 11 + Git Bash under a path containing
'(' and a space (fires, 3276-char context), and Windows 11 without
Git Bash (actionable error replaces the #1751 ParserError, reproduced
verbatim as control).
Fixes #1751
Fixes #1918
Diffstat (limited to 'scripts/package-codex-plugin.sh')
0 files changed, 0 insertions, 0 deletions
