summaryrefslogtreecommitdiff
path: root/tests/opencode/test-plugin-loading.sh
diff options
context:
space:
mode:
authorJesse Vincent <jesse@fsck.com>2026-07-16 00:13:35 +0000
committerJesse Vincent <jesse@fsck.com>2026-07-16 00:13:35 +0000
commit390bc07abbae22f6bcbeaea98a0c7216dd9d5281 (patch)
tree81572a1ec2f7df5fd5a157aa04f1d3a44e9b6b05 /tests/opencode/test-plugin-loading.sh
parentfb7b07088ed03da76508b8a70a87bf4f15b2412a (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 'tests/opencode/test-plugin-loading.sh')
0 files changed, 0 insertions, 0 deletions