Clean up deprecated ANSI processing code (Phase 4)

Removed the ansiCarryovers Map from server.ts since terminal emulation
now handles all ANSI sequence buffering internally. Marked ansi.ts and
ansi-carryover.ts as deprecated with JSDoc comments, but kept them for
backward compatibility and potential rollback.
This commit is contained in:
Jared Miller 2026-01-31 09:53:22 -05:00
parent 43648f7d60
commit 130f01a19f
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C
3 changed files with 12 additions and 3 deletions

View file

@ -1,3 +1,9 @@
/**
* @deprecated This module is deprecated. Terminal output is now handled by
* the headless terminal emulator in terminal.ts. Kept for backward compatibility.
* See docs/terminal-emulation.md for details.
*/
/**
* Detect and split any incomplete ANSI control sequence at the end of a chunk.
*

View file

@ -1,3 +1,9 @@
/**
* @deprecated This module is deprecated. Terminal output is now handled by
* the headless terminal emulator in terminal.ts. Kept for backward compatibility.
* See docs/terminal-emulation.md for details.
*/
// ANSI to HTML converter - processes escape sequences and renders as inline styled spans
const colors: Record<number, string> = {

View file

@ -35,8 +35,6 @@ import type {
const sseClients = new Set<ReadableStreamDefaultController<string>>();
const sessionWebSockets = new Map<number, ServerWebSocket<SessionData>>();
const sessionStates = new Map<number, SessionState>();
// Buffer for incomplete ANSI sequences per session to avoid leaking partial control codes
const ansiCarryovers = new Map<number, string>();
const sessionTerminals = new Map<number, TerminalSession>();
interface SessionData {
@ -686,7 +684,6 @@ const server = Bun.serve<SessionData>({
close(ws) {
if (ws.data.sessionId) {
sessionWebSockets.delete(ws.data.sessionId);
ansiCarryovers.delete(ws.data.sessionId);
// Dispose terminal emulator
const termSession = sessionTerminals.get(ws.data.sessionId);