|
|
@@ -16,6 +16,7 @@ import { Shell } from "@/shell/shell"
|
|
|
|
|
|
import { BashArity } from "@/permission/arity"
|
|
|
import { Truncate } from "./truncation"
|
|
|
+import { Plugin } from "@/plugin"
|
|
|
|
|
|
const MAX_METADATA_LENGTH = 30_000
|
|
|
const DEFAULT_TIMEOUT = Flag.OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS || 2 * 60 * 1000
|
|
|
@@ -162,11 +163,13 @@ export const BashTool = Tool.define("bash", async () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ const shellEnv = await Plugin.trigger("shell.env", { cwd }, { env: {} })
|
|
|
const proc = spawn(params.command, {
|
|
|
shell,
|
|
|
cwd,
|
|
|
env: {
|
|
|
...process.env,
|
|
|
+ ...shellEnv.env,
|
|
|
},
|
|
|
stdio: ["ignore", "pipe", "pipe"],
|
|
|
detached: process.platform !== "win32",
|