diff options
Diffstat (limited to 'docs/windows/polyglot-hooks.md')
| -rw-r--r-- | docs/windows/polyglot-hooks.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/windows/polyglot-hooks.md b/docs/windows/polyglot-hooks.md index 3da01ae..d753d90 100644 --- a/docs/windows/polyglot-hooks.md +++ b/docs/windows/polyglot-hooks.md @@ -51,6 +51,7 @@ hooks/ { "type": "command", "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start", + "powershell": "& \"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start", "shell": "bash", "async": false } @@ -63,6 +64,15 @@ hooks/ The path is quoted because `${CLAUDE_PLUGIN_ROOT}` may contain spaces. +### The `powershell` key + +GitHub Copilot (the CLI and VS Code) on Windows runs hook commands through +PowerShell regardless of the `shell` key (#2189), where a leading quoted path +parses as a string expression and the trailing bareword is an error +("Unexpected token 'session-start'"). Copilot uses the `powershell` key +instead of `command` when it is present, and it gives the same dispatch with +the `&` call operator. Claude Code ignores the key. + ## How `run-hook.cmd` Works at a High Level `run-hook.cmd` is a polyglot script: Windows treats the first block as batch |
