← Agent directory

Qwen Code

Partial MSYSTEM/TERM sniffing + Git Bash path lookup (its own) Windows macOS Linux Difficulty Medium

After forking gemini-cli it grew its own MSYSTEM/TERM sniffing and Git Bash lookup — set MSYSTEM=MINGW64 (experimental) to hit the installer-placed bash launcher.

PowerShell · set MSYSTEM (experimental — see notes)
[Environment]::SetEnvironmentVariable('MSYSTEM', 'MINGW64', 'User')

Steps

  1. Run the command above to persist MSYSTEM=MINGW64 to the user environment; reopen the terminal to take effect
  2. Once Qwen Code's isGitBash branch hits, it looks for bash.exe along PATH → C:\Program Files\Git\bin\bash.exe — the latter is placed by the niubash installer, so a hit routes through the launcher into niu

Verify

echo $MSYSTEM; echo "SHELL=$SHELL"; uname -s — MSYSTEM=MINGW64 and uname reporting MSYS_NT- means the bash branch was taken

Rollback

[Environment]::SetEnvironmentVariable('MSYSTEM', $null, 'User')

Notes & pitfalls

Sources

Chinese edition of this page: /agents/qwen-code/