From 3a00dff308396c4c920c7dc5956f2a2fdca98bb7 Mon Sep 17 00:00:00 2001 From: swapnil <78632212+swapnilpaliwal-sd@users.noreply.github.com> Date: Sat, 26 Sep 2026 03:06:27 -0700 Subject: [PATCH] windows: stop Git Bash expanding '*' in the CLI's arguments (#1369) Git Bash's runtime globs the arguments a native Windows process passes it, since no shell did. The npm launcher and the MCP server start bash with `*` unquoted, so `axiomcode path '*' X` reached the CLI as the working directory's file names. The release e2e caught it on its first Windows run. withPython, the environment every launcher (CLI, MCP, hooks) hands to bash, now adds noglob to MSYS on Windows, keeping any MSYS options the user set. Verified on Windows Server 2022: `axiomcode path * square` answered for file names before and for `*` after. --- plugins/axiomcode/mcp/find-python.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/axiomcode/mcp/find-python.js b/plugins/axiomcode/mcp/find-python.js index 1492f31a6..9e47abfd7 100644 --- a/plugins/axiomcode/mcp/find-python.js +++ b/plugins/axiomcode/mcp/find-python.js @@ -49,6 +49,10 @@ function withPython(env, py) { // Windows Python writes a pipe in the ANSI code page and opens files in it, so the first → in an answer raised // UnicodeEncodeError, and a source file in UTF-8 read wrong. UTF-8 mode fixes both; a user's own setting stands. if (process.platform === 'win32' && out.PYTHONUTF8 === undefined) out.PYTHONUTF8 = '1'; + // Git Bash's runtime expands wildcards in the arguments a native Windows process hands it, since no shell did: + // `axiomcode path '*' X` reached the CLI as the working directory's file names. noglob turns that off for every + // bash below (the CLI's, the MCP server's, the hooks'); other MSYS options a user set are kept. + if (process.platform === 'win32' && !/(^|\s)noglob(\s|$)/.test(out.MSYS || '')) out.MSYS = ((out.MSYS || '') + ' noglob').trim(); if (process.platform !== 'win32' && py.cmd.length === 1 && py.cmd[0] === 'python3') return out; // Windows keeps it as Path, and a second PATH key beside it would be one of two the child picks from. const key = Object.keys(out).find((k) => k.toUpperCase() === 'PATH') || 'PATH';