mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-16 19:36:54 +00:00
Git Bash/MSYS rewrites slash-prefixed native flags such as tasklist /FI into bogus paths. Apply the same MSYS_NO_PATHCONV and MSYS2_ARG_CONV_EXCL setdefault defaults the Python terminal_tool already ships, in the Desktop PTY env. Fixes #101826
20 lines
561 B
TypeScript
20 lines
561 B
TypeScript
// Git Bash/MSYS rewrite slash-prefixed native flags (`/FI`) into paths.
|
|
// Set these two opt-outs on Windows unless already present.
|
|
export function applyWindowsMsysBashEnvDefaults(
|
|
env: NodeJS.ProcessEnv,
|
|
isWindows: boolean = process.platform === 'win32'
|
|
): NodeJS.ProcessEnv {
|
|
if (!isWindows) {
|
|
return env
|
|
}
|
|
|
|
if (!Object.prototype.hasOwnProperty.call(env, 'MSYS_NO_PATHCONV')) {
|
|
env.MSYS_NO_PATHCONV = '1'
|
|
}
|
|
|
|
if (!Object.prototype.hasOwnProperty.call(env, 'MSYS2_ARG_CONV_EXCL')) {
|
|
env.MSYS2_ARG_CONV_EXCL = '*'
|
|
}
|
|
|
|
return env
|
|
}
|