The open source coding agent.
TypeScript
do not print error on ctrl+c during prompts
Dax Raad0fc8dfc77e88
diff --git a/packages/opencode/src/cli/error.ts b/packages/opencode/src/cli/error.tsindex bb7186e88ed..752ad696461 100644--- a/packages/opencode/src/cli/error.ts+++ b/packages/opencode/src/cli/error.ts@@ -1,5 +1,6 @@import { Config } from "../config/config"import { MCP } from "../mcp"+import { UI } from "./ui"export function FormatError(input: unknown) {if (MCP.Failed.isInstance(input))@@ -13,4 +14,6 @@ export function FormatError(input: unknown) {(issue) => "↳ " + issue.message + " " + issue.path.join("."),) ?? []),].join("\n")++ if (UI.CancelledError.isInstance(input)) return ""}diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.tsindex 089f17b0e07..54b530955db 100644--- a/packages/opencode/src/index.ts+++ b/packages/opencode/src/index.ts@@ -170,7 +170,7 @@ try {Log.Default.error("fatal", data)const formatted = FormatError(e)if (formatted) UI.error(formatted)- if (!formatted)+ if (formatted === undefined)UI.error("Unexpected error, check log file at " + Log.file() + " for more details",)