openclaw - 💡(How to fix) Fix Feature Request: Add tools.exec.shell config to specify default shell executable [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59998Fetched 2026-04-08 02:37:44
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Error Message

  • Is error-prone with complex commands

Fix Action

Fix / Workaround

Describe alternatives you've considered The current workaround is to manually wrap every command in a bash invocation (e.g., cmd /c "bash.exe -c \"...\""), but this:

  • Requires manual escaping for every call
  • Is error-prone with complex commands
  • Doesn't scale — there's no way to make it the default behavior

Code Example

{
  "tools": {
    "exec": {
      "shell": "C:\\Users\\Pheobe\\AppData\\Local\\Fork\\gitInstance\\2.50.1\\bin\\bash.exe"
    }
  }
}
RAW_BUFFERClick to expand / collapse

Feature Request: tools.exec.shell configuration option

Is your feature request related to a problem? Please describe. On Windows, the exec tool defaults to PowerShell/cmd. Users who prefer bash (e.g., Git Bash from MSYS2, Cygwin, or Fork git's bundled bash) have no way to change this default behavior globally.

Describe the solution you'd like Add a tools.exec.shell configuration field (e.g., C:\\path\\to\\bash.exe on Windows, or just bash on Unix) that controls which shell the exec tool uses to interpret commands. On Windows, instead of launching cmd.exe or powershell.exe, OpenClaw would launch the configured shell executable directly.

Describe alternatives you've considered The current workaround is to manually wrap every command in a bash invocation (e.g., cmd /c "bash.exe -c \"...\""), but this:

  • Requires manual escaping for every call
  • Is error-prone with complex commands
  • Doesn't scale — there's no way to make it the default behavior

A per-agent or global tools.exec.shell field in openclaw.json would solve this cleanly.

Additional context Schema path would be: tools.exec.shell (string, optional)

Example configuration:

{
  "tools": {
    "exec": {
      "shell": "C:\\Users\\Pheobe\\AppData\\Local\\Fork\\gitInstance\\2.50.1\\bin\\bash.exe"
    }
  }
}

This would allow Windows users with Git Bash (or other shells) to use their preferred shell consistently across all exec calls without manual wrapping.

extent analysis

TL;DR

To address the issue, consider adding a tools.exec.shell configuration option to specify the default shell for the exec tool.

Guidance

  • Introduce a tools.exec.shell configuration field in openclaw.json to allow users to specify their preferred shell.
  • Update the exec tool to use the configured shell executable instead of defaulting to PowerShell/cmd on Windows.
  • Validate the provided shell path to ensure it exists and is executable.
  • Document the new configuration option and its usage to help users transition to the new behavior.

Example

{
  "tools": {
    "exec": {
      "shell": "C:\\path\\to\\bash.exe"
    }
  }
}

Notes

This solution assumes that the exec tool can be modified to accept and use the configured shell. Additional error handling and validation may be necessary to ensure the feature works correctly in different environments.

Recommendation

Apply workaround by adding the tools.exec.shell configuration option, as it provides a flexible solution for users to specify their preferred shell without modifying the underlying exec tool behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING