From 5d87002df1ba1d6ff89a39568e40cee10fec5f29 Mon Sep 17 00:00:00 2001 From: Tomas Valenta Date: Wed, 16 Oct 2024 14:21:44 -0700 Subject: [PATCH] Don't print stack trace on user terminal interrupt --- .changeset/eleven-tomatoes-talk.md | 5 +++++ packages/cli/src/terminal.ts | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/eleven-tomatoes-talk.md diff --git a/.changeset/eleven-tomatoes-talk.md b/.changeset/eleven-tomatoes-talk.md new file mode 100644 index 000000000..1e45e79e8 --- /dev/null +++ b/.changeset/eleven-tomatoes-talk.md @@ -0,0 +1,5 @@ +--- +'@e2b/cli': patch +--- + +Don't print stack trace when user interrupts sandbox terminal connection diff --git a/packages/cli/src/terminal.ts b/packages/cli/src/terminal.ts index e27a9e97a..a29bf2e87 100644 --- a/packages/cli/src/terminal.ts +++ b/packages/cli/src/terminal.ts @@ -37,6 +37,10 @@ export async function spawnConnectedTerminal(sandbox: e2b.Sandbox) { if (err.exitCode === -1 && err.error === 'signal: killed') { return } + if (err.exitCode === 130) { + console.warn('Terminal session was killed by user') + return + } } throw err } finally {