From acd677bff5398b242b6e3d32d0e8c573db71fc49 Mon Sep 17 00:00:00 2001 From: James Murdza Date: Wed, 12 Jun 2024 06:05:12 -0400 Subject: [PATCH] Fix display bugs in the console. --- backend/server/src/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/server/src/index.ts b/backend/server/src/index.ts index b381420..f1e9576 100644 --- a/backend/server/src/index.ts +++ b/backend/server/src/index.ts @@ -383,7 +383,7 @@ io.on("connection", async (socket) => { console.log("process", toBackslashNotation(data.toString())); io.emit("terminalResponse", { id, - data: data.toString(), + data: data.toString() + "\r\n", }); }; @@ -395,8 +395,9 @@ io.on("connection", async (socket) => { onStderr: onData, onExit: (code) => console.log("exit :(", code), }); - terminals[id].sendStdin("export PS1='\\u > '\r\n"); - terminals[id].sendStdin("clear\r\n"); + await terminals[id].sendStdin("clear\r\n"); + await terminals[id].sendStdin("export PS1='user> '\r\n"); + await terminals[id].sendStdin("clear\r\n"); console.log("Created terminal", id); });