diff --git a/public/terminal-session.ts b/public/terminal-session.ts index 2ec5731..e58709d 100644 --- a/public/terminal-session.ts +++ b/public/terminal-session.ts @@ -19,9 +19,7 @@ import { folderFromTitle, cwdFromOsc7 } from './title-util.js' const RESET = '\x1b[0m' const BOLD = '\x1b[1m' const DIM = '\x1b[2m' -const YELLOW = '\x1b[33m' const RED = '\x1b[31m' -const GREEN = '\x1b[32m' const CYAN = '\x1b[36m' function statusLine(msg: string): string { @@ -195,16 +193,14 @@ export class TerminalSession { connect(): void { if (this.disposed || this.isConnecting) return this.isConnecting = true - this.setStatus('connecting') - this.term.write(statusLine(`${YELLOW}Connecting…${RESET}`)) + this.setStatus('connecting') // connection state shows on the tab dot, not in the terminal const socket = new WebSocket(buildWsUrl()) this.ws = socket socket.addEventListener('open', () => { this.reconnectDelay = 1000 - this.setStatus('connected') - this.term.write(statusLine(`${GREEN}${BOLD}Connected${RESET}`)) + this.setStatus('connected') // tab dot turns green; no in-terminal "Connected" line // Send cwd only on a fresh session (M6 "new tab here"); on reconnect the // sessionId is already set and the server ignores cwd. const attachMsg: ClientMessage = @@ -282,12 +278,9 @@ export class TerminalSession { private scheduleReconnect(): void { if (this.reconnectTimer !== null) return - this.setStatus('reconnecting') + this.setStatus('reconnecting') // amber tab dot signals it; no in-terminal line const delay = this.reconnectDelay this.reconnectDelay = Math.min(this.reconnectDelay * 2, 30_000) - this.term.write( - statusLine(`${YELLOW}Disconnected — reconnecting in ${(delay / 1000).toFixed(0)}s…${RESET}`), - ) this.reconnectTimer = setTimeout(() => { this.reconnectTimer = null this.connect()