Skip to content

Fix quoted hook commands on Windows - #33926

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/0e7ce44203e01d3823daaaec750c2aeadfcd34b7
Jul 17, 2026
Merged

Fix quoted hook commands on Windows#33926
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/0e7ce44203e01d3823daaaec750c2aeadfcd34b7

Conversation

@copyberry

@copyberry copyberry Bot commented Jul 17, 2026

Copy link
Copy Markdown

Fix quoted hook commands on Windows

Why

Windows hook commands whose executable paths contain spaces fail when their
outer quotes are escaped during argument construction.

What changed

  • Pass hook command strings as raw arguments to the default Windows shell.
  • Do the same for configured shells that use the case-insensitive /c flag,
    while retaining normal argument handling for other shells.

Testing

Add a Windows regression test that runs a quoted .cmd hook from a directory
with spaces through both the default shell and an explicit COMSPEC /c shell.

## Why

Windows hook commands whose executable paths contain spaces fail when their
outer quotes are escaped during argument construction.

## What changed

- Pass hook command strings as raw arguments to the default Windows shell.
- Do the same for configured shells that use the case-insensitive `/c` flag,
  while retaining normal argument handling for other shells.

## Testing

Add a Windows regression test that runs a quoted `.cmd` hook from a directory
with spaces through both the default shell and an explicit `COMSPEC /c` shell.

GitOrigin-RevId: 0e7ce44203e01d3823daaaec750c2aeadfcd34b7
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/0e7ce44203e01d3823daaaec750c2aeadfcd34b7 branch from fc80533 to 3ac476b Compare July 17, 2026 23:25
@copyberry
copyberry Bot merged commit 3ac476b into main Jul 17, 2026
14 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/0e7ce44203e01d3823daaaec750c2aeadfcd34b7 branch July 17, 2026 23:26
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 17, 2026
@Sqble
Sqble temporarily deployed to issue-triage July 17, 2026 23:38 — with GitHub Actions Inactive
@Sqble
Sqble temporarily deployed to issue-triage July 17, 2026 23:38 — with GitHub Actions Inactive
@Sqble
Sqble temporarily deployed to issue-triage July 17, 2026 23:38 — with GitHub Actions Inactive
@Sqble
Sqble temporarily deployed to issue-triage July 17, 2026 23:39 — with GitHub Actions Inactive
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants