From 08225b30ebdcf046246a10ec1e6eac2f8d2be287 Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Fri, 31 Jul 2020 10:18:26 -0600 Subject: [PATCH] Report terminal crash --- backend/src/api.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/src/api.ts b/backend/src/api.ts index 282f9f9..f53fe9f 100644 --- a/backend/src/api.ts +++ b/backend/src/api.ts @@ -350,6 +350,15 @@ export class Session { this.send({ event: "terminalOutput", output: data }); } }); + this.term.pty.on("exit", (code, signal) => { + if (term.live) { + this.send({ + event: "serviceFailed", + service: "terminal", + error: `Exited with status ${signal || code}`, + }); + } + }); } catch (err) { this.log(`Error while running user code`); console.log(err);