Skip to content

Commit a9a3d42

Browse files
committed
fix: ws.close instead of ws.terminate. Improved progress display
1 parent 7c18fec commit a9a3d42

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/connect/http-routes/create-command.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export function createCommandHandler({ name, command, spawnCommand, onExit }: Pa
8181
})
8282

8383
pty.onExit(async ({ exitCode, signal }) => {
84-
console.log(`Command ${name} exited with exit code`, exitCode);
84+
console.log(`Command ${name} ( ${sessionId} ) exited with exit code`, exitCode);
8585
ws.send(Buffer.from(chalk.blue(`Session ended exit code ${exitCode}`), 'utf8'))
8686

8787
const mainWs = SocketServer.get().getMainConnection(clientId);
@@ -90,7 +90,7 @@ export function createCommandHandler({ name, command, spawnCommand, onExit }: Pa
9090
mainWs.send(JSON.stringify({ key: `finish:${sessionId}`, success: exitCode === 0, data })) // Send finish command only if client connection is still open
9191
}
9292

93-
ws.terminate();
93+
ws.close();
9494
server.close();
9595
})
9696

src/connect/socket-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class SocketServer {
114114
});
115115

116116
wss.on('close', () => {
117-
console.log('Session closed');
117+
console.log('Session closed', sessionId);
118118
this.sessions.delete(sessionId);
119119
})
120120
}

src/ui/components/progress/progress-display.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export function SubProgressDisplay(
9494

9595
return <>
9696
{hiddenCount > 0 && (
97-
<Text dimColor><Text color="greenBright" dimColor={false}></Text> and {hiddenCount} other{hiddenCount !== 1 ? 's' : ''}...</Text>
97+
<Text><Text color="greenBright"></Text><Text dimColor> and {hiddenCount} other{hiddenCount !== 1 ? 's' : ''}...</Text></Text>
9898
)}
9999
{sorted.map((s, idx) => {
100100
if (s.status === ProgressStatus.IN_PROGRESS) return <Spinner key={idx} label={s.label} type="dots" />;

0 commit comments

Comments
 (0)