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:
parent
43648f7d60
commit
130f01a19f
3 changed files with 12 additions and 3 deletions
|
|
@ -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.
|
* Detect and split any incomplete ANSI control sequence at the end of a chunk.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -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
|
// ANSI to HTML converter - processes escape sequences and renders as inline styled spans
|
||||||
|
|
||||||
const colors: Record<number, string> = {
|
const colors: Record<number, string> = {
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,6 @@ import type {
|
||||||
const sseClients = new Set<ReadableStreamDefaultController<string>>();
|
const sseClients = new Set<ReadableStreamDefaultController<string>>();
|
||||||
const sessionWebSockets = new Map<number, ServerWebSocket<SessionData>>();
|
const sessionWebSockets = new Map<number, ServerWebSocket<SessionData>>();
|
||||||
const sessionStates = new Map<number, SessionState>();
|
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>();
|
const sessionTerminals = new Map<number, TerminalSession>();
|
||||||
|
|
||||||
interface SessionData {
|
interface SessionData {
|
||||||
|
|
@ -686,7 +684,6 @@ const server = Bun.serve<SessionData>({
|
||||||
close(ws) {
|
close(ws) {
|
||||||
if (ws.data.sessionId) {
|
if (ws.data.sessionId) {
|
||||||
sessionWebSockets.delete(ws.data.sessionId);
|
sessionWebSockets.delete(ws.data.sessionId);
|
||||||
ansiCarryovers.delete(ws.data.sessionId);
|
|
||||||
|
|
||||||
// Dispose terminal emulator
|
// Dispose terminal emulator
|
||||||
const termSession = sessionTerminals.get(ws.data.sessionId);
|
const termSession = sessionTerminals.get(ws.data.sessionId);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue