Skip to content

[Bug]: Windows bash tool fails with "export is not recognized" #11927

@Qfbxz

Description

@Qfbxz

Severity: High - Critical functionality broken on Windows

Environment:

  • Platform: Windows (Native, not WSL)
  • OpenCode Version: Latest dev branch
  • Shell: cmd.exe via bash tool

Bug Description:

When executing any command through OpenCode's bash tool on Windows, the tool automatically prefixes commands with Unix-style environment variable exports:

export CI=true DEBIAN_FRONTEND=noninteractive ...

However, Windows cmd.exe does not support the export command, causing all commands to fail with:

'export' is not recognized as an internal or external command,
operable program or batch file.

Root Cause: The bash tool unconditionally adds export prefix without platform detection.

Impact: 100% of bash commands fail on Windows native.

Proposed Fix: Add platform detection to strip export on Windows.

Reproduction: Run any bash command on Windows native - all fail with the same error

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions