diff options
| author | Dax Raad <[email protected]> | 2025-06-24 22:09:43 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-06-24 22:09:43 -0400 |
| commit | 0fc8dfc77e88bcbc40f61f4f799e51e65e886b25 (patch) | |
| tree | 8ab4932250e2b2371eb1c294acfa2cf5dd57b508 | |
| parent | 81b7df61ecd00d09f8a3ce337a9be3c31679eafe (diff) | |
| download | opencode-0fc8dfc77e88bcbc40f61f4f799e51e65e886b25.tar.gz opencode-0fc8dfc77e88bcbc40f61f4f799e51e65e886b25.zip | |
do not print error on ctrl+c during prompts
| -rw-r--r-- | packages/opencode/src/cli/error.ts | 3 | ||||
| -rw-r--r-- | packages/opencode/src/index.ts | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/packages/opencode/src/cli/error.ts b/packages/opencode/src/cli/error.ts index bb7186e88..752ad6964 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.ts index 089f17b0e..54b530955 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", ) |
