From 0dd42e290113da9e5698fbc15a11e7c87a296423 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Wed, 4 Feb 2026 14:52:13 +0900 Subject: [PATCH] fix(non-interactive-env): force unix export syntax for bash env prefix Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- src/hooks/non-interactive-env/index.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/hooks/non-interactive-env/index.ts b/src/hooks/non-interactive-env/index.ts index 193160820..0acfaadcc 100644 --- a/src/hooks/non-interactive-env/index.ts +++ b/src/hooks/non-interactive-env/index.ts @@ -1,6 +1,6 @@ import type { PluginInput } from "@opencode-ai/plugin" import { HOOK_NAME, NON_INTERACTIVE_ENV, SHELL_COMMAND_PATTERNS } from "./constants" -import { log, buildEnvPrefix, detectShellType } from "../../shared" +import { log, buildEnvPrefix } from "../../shared" export * from "./constants" export * from "./detector" @@ -52,11 +52,9 @@ export function createNonInteractiveEnvHook(_ctx: PluginInput) { // The env vars (GIT_EDITOR=:, EDITOR=:, etc.) must ALWAYS be injected // for git commands to prevent interactive prompts. - // Detect the shell type dynamically to support native Windows shells - // (cmd.exe, PowerShell) in addition to Unix-like shells (bash, zsh). - // Fixes Windows compatibility issues when running without Git Bash/WSL. - const shellType = detectShellType() - const envPrefix = buildEnvPrefix(NON_INTERACTIVE_ENV, shellType) + // The bash tool always runs in a Unix-like shell (bash/sh), even on Windows + // (via Git Bash, WSL, etc.), so always use unix export syntax. + const envPrefix = buildEnvPrefix(NON_INTERACTIVE_ENV, "unix") output.args.command = `${envPrefix} ${command}` log(`[${HOOK_NAME}] Prepended non-interactive env vars to git command`, {