Skip to content

feat(shell): add configurable shell support for Windows#839

Open
HamzaETTH wants to merge 1 commit intoMoonshotAI:mainfrom
HamzaETTH:main
Open

feat(shell): add configurable shell support for Windows#839
HamzaETTH wants to merge 1 commit intoMoonshotAI:mainfrom
HamzaETTH:main

Conversation

@HamzaETTH
Copy link

@HamzaETTH HamzaETTH commented Feb 2, 2026

Related Issue

Resolve #792

Description

Add [shell] configuration section to allow Windows users to use bash (Git Bash, MSYS2, Cygwin, WSL) instead of being forced to use PowerShell.

Motivation: LLMs tend to generate bash commands (e.g., with &&, ||, export) that fail in PowerShell. This change allows Windows users to use bash for better command compatibility with LLM-generated commands.

Changes:

  • Add ShellConfig class with 'path' and 'preferred' options
  • Implement hybrid shell detection with priority order:
    1. Explicit config path
    2. SHELL environment variable (only when preferred='auto')
    3. Auto-detect based on preferred setting
    4. PowerShell fallback (backwards compatible)
  • Auto-detect bash from common Windows locations (Git Bash, MSYS2, Cygwin, WSL)
  • Treat fish as unknown shell (not bash-compatible)
  • Update shell tool to use correct args per shell type
  • Log warning when explicit shell path not found
  • Add comprehensive tests for shell detection
  • Update documentation (EN/ZH)

Backwards compatible: default behavior unchanged (PowerShell on Windows).

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

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Open with Devin

Add [shell] configuration section to allow Windows users to use bash
(Git Bash, MSYS2, Cygwin, WSL) instead of being forced to use PowerShell.

Motivation: LLMs tend to generate bash commands (e.g., with &&, ||, export)
that fail in PowerShell. This change allows Windows users to use bash for
better command compatibility with LLM-generated commands.

Changes:
- Add ShellConfig class with 'path' and 'preferred' options
- Implement hybrid shell detection with priority order:
  1. Explicit config path
  2. SHELL environment variable (only when preferred='auto')
  3. Auto-detect based on preferred setting
  4. PowerShell fallback (backwards compatible)
- Auto-detect bash from common Windows locations (Git Bash, MSYS2, Cygwin, WSL)
- Treat fish as unknown shell (not bash-compatible)
- Update shell tool to use correct args per shell type
- Log warning when explicit shell path not found
- Add comprehensive tests for shell detection
- Update documentation (EN/ZH)

Backwards compatible: default behavior unchanged (PowerShell on Windows).

Example config:
    [shell]
    path = "C:/Program Files/Git/bin/bash.exe"
    # OR
    preferred = "bash"  # auto, powershell, bash
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional flags.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant