Skip to content

Configurable Shell Support for Windows: Allow bash (Git Bash/MSYS2/Cygwin) instead of PowerShell #792

Description

@HamzaETTH

What feature would you like to see?

On Windows, kimi-cli currently hardcodes PowerShell as the shell for executing commands. This causes significant issues because:

  1. LLMs are trained primarily on bash syntax - Most LLMs generate bash commands by default
  2. Common bash patterns fail in PowerShell:
    • ls -la && cat file.txt → Error: '&&' is not a valid statement separator
    • export VAR=value → Error: export is not recognized
    • cat file | grep pattern → Pipeline syntax differs
  3. Standard Unix tools unavailable - PowerShell lacks grep, awk, sed, ls by default

Proposed Solution

Add a [shell] configuration section to ~/.kimi/config.toml with hybrid detection:

Priority order:

  1. Explicit path (shell.path)
  2. SHELL environment variable (Git Bash sets this)
  3. Auto-detect based on shell.preferred setting
  4. PowerShell fallback (backwards compatible)

Example config:

  [shell]
  path = "C:/Program Files/Git/bin/bash.exe"
  # OR
  preferred = "bash"  # "auto" (default), "powershell", "bash"

Benefits

• LLM-generated bash commands work correctly
• Cross-platform consistency
• Zero-config for Git Bash users (just launch from Git Bash)
• Backwards compatible (default unchanged)

──────────────────────────────────────────────────────────────────────

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions