mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-06 17:34:58 +01:00
sync
This commit is contained in:
@@ -146,11 +146,6 @@ export const BashTool = Tool.define("bash", {
|
||||
})
|
||||
}
|
||||
|
||||
const pause = (ms: number) =>
|
||||
new Promise<void>((resolve) => {
|
||||
setTimeout(resolve, ms)
|
||||
})
|
||||
|
||||
const proc = spawn(params.command, {
|
||||
shell: true,
|
||||
cwd: Instance.directory,
|
||||
@@ -202,13 +197,13 @@ export const BashTool = Tool.define("bash", {
|
||||
|
||||
try {
|
||||
process.kill(-pid, "SIGTERM")
|
||||
await pause(SIGKILL_TIMEOUT_MS)
|
||||
await Bun.sleep(SIGKILL_TIMEOUT_MS)
|
||||
if (!exited) {
|
||||
process.kill(-pid, "SIGKILL")
|
||||
}
|
||||
} catch (_e) {
|
||||
proc.kill("SIGTERM")
|
||||
await pause(SIGKILL_TIMEOUT_MS)
|
||||
await Bun.sleep(SIGKILL_TIMEOUT_MS)
|
||||
if (!exited) {
|
||||
proc.kill("SIGKILL")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user