refactor(core): replace bash tool with shell tool

This commit is contained in:
Dax Raad
2026-06-29 00:44:17 -04:00
parent 595c6bd4a7
commit 5ae93092aa
37 changed files with 2260 additions and 901 deletions
+4 -4
View File
@@ -35,7 +35,7 @@ import { Tool } from "@/tool/tool"
import { Permission } from "@/permission"
import { SessionStatus } from "./status"
import { LLM } from "./llm"
import { Shell } from "@opencode-ai/core/shell"
import { ShellSelect } from "@opencode-ai/core/shell/select"
import { ShellID } from "@/tool/shell/id"
import { FSUtil } from "@opencode-ai/core/fs-util"
import { Truncate } from "@/tool/truncate"
@@ -520,8 +520,8 @@ export const layer = Layer.effect(
}).pipe(Effect.ensuring(markReady))
const cfg = yield* config.get()
const sh = Shell.preferred(cfg.shell)
const args = Shell.args(sh, input.command, cwd)
const sh = ShellSelect.preferred(cfg.shell)
const args = ShellSelect.args(sh, input.command, cwd)
let output = ""
let aborted = false
@@ -1396,7 +1396,7 @@ export const layer = Layer.effect(
const shellMatches = ConfigMarkdown.shell(template)
if (shellMatches.length > 0) {
const cfg = yield* config.get()
const sh = Shell.preferred(cfg.shell)
const sh = ShellSelect.preferred(cfg.shell)
const results = yield* Effect.promise(() =>
Promise.all(
shellMatches.map(async ([, cmd]) => (await Process.text([cmd], { shell: sh, nothrow: true })).text),