GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Desktop app always uses SHELL (WSL) on Windows · Issue #8396 · anomalyco/opencode

Desktop app always uses SHELL (WSL) on Windows #8396

New issue
Copy link
New issue
Copy link
Closed
Closed
Desktop app always uses SHELL (WSL) on Windows#8396
Copy link
Assignees
adamdotdevin
Labels
bugSomething isn't workingwebRelates to opencode on web / desktopwindows

Description

@mizaibear
mizaibear
opened on Jan 14, 2026
Issue body actions

Description

Desktop app ignores OPENCODE_GIT_BASH_PATH.
when execution with BashTool, always uses SHELL (WSL) on Windows

Environment:

  • OS: Windows 10
  • OpenCode: Desktop version
  • Git Bash: Installed at C:\Program Files\Git\bin\bash.exe
  • WSL: Ubuntu installed
  • OPENCODE_GIT_BASH_PATH set to C:\Program Files\Git\bin\bash.exe in Windows environment variables
$ where bash
C:\Program Files\Git\usr\bin\bash.exe
C:\Windows\System32\bash.exe

Description:
The desktop app ignores the OPENCODE_GIT_BASH_PATH environment variable when spawning the CLI sidecar. The CLI shell detection logic in shell.ts prioritizes process.env.SHELL over OPENCODE_GIT_BASH_PATH, causing it to use WSL bash instead of Git Bash. This breaks the Bash tool since Windows environment variables (PATH, PYTHONPATH, etc.) are not inherited by the WSL environment.

Reproduction:

  1. Install OpenCode Desktop on Windows
  2. Install Git Bash and WSL
  3. Set OPENCODE_GIT_BASH_PATH=C:\Program Files\Git\bin\bash.exe in Windows environment variables

Expected Behavior:
The Bash tool should use Git Bash as configured via OPENCODE_GIT_BASH_PATH, preserving all Windows environment variables.

Actual Behavior:
The Bash tool uses WSL bash (from SHELL environment variable), causing:

  • All Windows environment variables to be unavailable
  • Commands requiring Windows tools to fail
  • Configurations in Git Bash (PATH, npm, Python, etc.) to be ignored

Root Cause:
In packages/desktop/src-tauri/src/cli.rs, the create_command() function for Windows does not pass the OPENCODE_GIT_BASH_PATH environment variable to the CLI sidecar:

#[cfg(target_os = "windows")]
pub fn create_command(app: &tauri::AppHandle, args: &str) -> Command {
    // ... existing env variables ...
    .env("OPENCODE_CLIENT", "desktop")
    .env("XDG_STATE_HOME", &state_dir);
    // Missing: .env("OPENCODE_GIT_BASH_PATH", ...)
}

The CLI's shell detection in packages/opencode/src/shell/shell.ts prioritizes SHELL:

export const acceptable = lazy(() => {
  const s = process.env.SHELL  // Checked first
  if (s && !BLACKLIST.has(...)) return s
  return fallback()  // OPENCODE_GIT_BASH_PATH is only checked here
})

Plugins

No response

OpenCode version

1.1.19

Steps to reproduce

1.Git-Bash Installed.
2.WSL Installed.

Screenshot and/or share link

No response

Operating System

Win10 22H2

Terminal

OpenCode-Desktop-Win64

Activity

  1. mizaibear
    added
    bugSomething isn't working
    on Jan 14, 2026
  2. github-actions
    assigned
    adamdotdevin
    on Jan 14, 2026
  3. github-actions
    added
    webRelates to opencode on web / desktop
    windows
    on Jan 14, 2026
  4. github-actions commented on Jan 14, 2026

    @github-actions
    github-actionsBot
    on Jan 14, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • 2 bugs spotted when running Windows Desktop connects to opencode server in WSL: Shell runtime & Path Detection #8378: 2 bugs spotted when running Windows Desktop connects to opencode server in WSL: Shell runtime & Path Detection - specifically addresses shell detection logic issues with process.env.SHELL not being properly handled in WSL/Windows environments

    Feel free to ignore if this doesn't address your specific case.

  5. pschiel commented on Jan 15, 2026

    @pschiel
    pschiel
    on Jan 15, 2026
    Contributor
    More actions

    You need to get your PATH order right in order for this to work.

    WSL bash lives in C:/Windows/System32

    if you want git bash to be executed, this needs to have higher priority:

    Image

    on top you can also set both env variables SHELL and OPENCODE_GIT_BASH_PATH to be on the safe side:

    Image
    Reacted by mizaibear
  6. anddam commented on Jan 19, 2026

    @anddam
    anddam
    on Jan 19, 2026
    More actions

    @mizaibear

    This breaks the Bash tool since Windows environment variables (PATH, PYTHONPATH, etc.) are not inherited by the WSL environment.

    Check https://learn.microsoft.com/en-us/windows/wsl/wsl-config#interop-settings for adding windows PATH to the WSL env, and https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows/ for the other vars.

    Reacted by mizaibear
  7. pschiel commented on Jan 19, 2026

    @pschiel
    pschiel
    on Jan 19, 2026
    Contributor
    More actions

    @mizaibear

    This breaks the Bash tool since Windows environment variables (PATH, PYTHONPATH, etc.) are not inherited by the WSL environment.

    Check https://learn.microsoft.com/en-us/windows/wsl/wsl-config#interop-settings for adding windows PATH to the WSL env, and https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows/ for the other vars.

    Mixing both systems will cause a lot of errors, because WSL cant handle Windows paths at all. Working with Windows programs, those paths will inevitably occur.

    Windows paths are added by default and can be removed with

    [interop]
    appendWindowsPath = false
    

    Git bash, MSYS, Powershell, cmd, were already a challenge to get fixed, you're setting yourself up for a whole bunch of issues. WSL works if you stay inside its VM.

    Reacted by mizaibear
  8. mizaibear
    closed this as completedon Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @adamdotdevin
    adamdotdevin

Labels

bugSomething isn't workingwebRelates to opencode on web / desktopwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.