From e000a3bb0da38c5f249f512864c35e58785436df Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Wed, 25 Mar 2026 01:23:02 +0900 Subject: [PATCH] fix(non-interactive-env): force unix prefix for bash git commands Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- src/hooks/non-interactive-env/non-interactive-env-hook.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hooks/non-interactive-env/non-interactive-env-hook.ts b/src/hooks/non-interactive-env/non-interactive-env-hook.ts index 3cf70811c..a4d555479 100644 --- a/src/hooks/non-interactive-env/non-interactive-env-hook.ts +++ b/src/hooks/non-interactive-env/non-interactive-env-hook.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,9 +52,7 @@ 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 current shell type for proper env var syntax (export for bash/zsh, setenv for csh/tcsh, etc.) - const shellType = detectShellType() - const envPrefix = buildEnvPrefix(NON_INTERACTIVE_ENV, shellType) + const envPrefix = buildEnvPrefix(NON_INTERACTIVE_ENV, "unix") // Check if the command already starts with the prefix to avoid stacking. // This maintains the non-interactive behavior and makes the operation idempotent.