Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

[Bug]: non-interactive-env still hardcodes Unix export prefix on Windows in v3.10.0 #2344

@Brisbanehuang

Description

@Brisbanehuang

Prerequisites

  • I have searched existing issues to avoid duplicates
  • I am using the latest version of oh-my-opencode
  • I have read the documentation

Bug Description

This appears to be a regression / incomplete fix of the previously closed Windows shell compatibility issue.

On Windows, non-interactive-env still prepends a Unix-style export ...; prefix to git commands in v3.10.0, which breaks execution in cmd.exe and PowerShell.

The previous issue #566 was closed, but the current v3.10.0 build still contains a hardcoded Unix shell type in the compiled hook implementation.

Steps to Reproduce

  1. Install the latest package:
    npm install -g oh-my-opencode@3.10.0
  2. Use OpenCode on Windows with oh-my-opencode enabled.
  3. Execute a git command through the bash tool, for example git status.
  4. Observe that the command is rewritten with a Unix-style prefix:
    export CI=true DEBIAN_FRONTEND=noninteractive GIT_TERMINAL_PROMPT=0 ...; git status
    
  5. In Windows shells this fails with:
    'export' is not recognized as an internal or external command,
    operable program or batch file.
    

Expected Behavior

The hook should either:

  • detect the actual shell and emit shell-appropriate syntax, or
  • avoid prepending Unix syntax on Windows entirely, or
  • only run when the environment is truly non-interactive.

Actual Behavior

non-interactive-env still prepends a Unix export ...; prefix on Windows in the latest release.

Evidence

Local verification after upgrading to 3.10.0:

  • Installed package version:

    • C:\Users\hacke\AppData\Roaming\npm\node_modules\oh-my-opencode\package.json
    • "version": "3.10.0"
  • Compiled hook implementation still contains:

    • C:\Users\hacke\AppData\Roaming\npm\node_modules\oh-my-opencode\dist\index.js:40242
    • const envPrefix = buildEnvPrefix(NON_INTERACTIVE_ENV, "unix");
  • The shell-aware helper still exists in the same build:

    • C:\Users\hacke\AppData\Roaming\npm\node_modules\oh-my-opencode\dist\index.js:17322
    • function buildEnvPrefix(env, shellType) { ... }
    • with explicit branches for unix, powershell, and cmd

So the issue is not that shell-specific support is missing globally; it is that this hook still forces "unix".

Workaround

Disabling the hook avoids the problem:

{
  "disabled_hooks": ["non-interactive-env"]
}

Additional Context

Related previously closed issue: #566

This new report is specifically about the latest release (v3.10.0) still shipping code that hardcodes Unix behavior in the Windows path.

Operating System

Windows

OpenCode Version

opencode-ai 1.2.20

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions