fwd.ts
) bypass the clear sequence truncation in stream-watcher.ts
, sending entire gigabyte files instead of the last 2MB\x1b[2J
) and re-renders entire scroll buffer on every resize event, creating exponential data growthFile | Purpose | Critical Functions |
---|---|---|
server.ts | Main web server | HTTP endpoints, WebSocket handling |
pty-manager.ts | PTY lifecycle management | createSession() , setupPtyHandlers() |
stream-watcher.ts | Monitors ascinema files | sendExistingContent() - implements clear truncation |
fwd.ts | External terminal forwarding | Process spawning, BYPASSES TRUNCATION |
terminal-manager.ts | Binary buffer rendering | Converts ANSI to binary cells format |
/api/sessions/:id/input
onData
handler/api/sessions/:id/stream
(text/ascinema format)/buffers
(binary cell format)fwd.ts
bypass the clear sequence truncation logic.
Technical Details:
sendExistingContent()
, sending gigabyte files to clients.
sendExistingContent()
truncation.
Investigation Needed:
fwd.ts
connects to client streamsMetric | Current | After Fix |
---|---|---|
980MB session initial load | Infinite/Crash | 2-3 seconds |
Data sent to client | 980MB | 2MB |
Memory per terminal | 50-100MB | Target: 10MB |
Clear sequence scan time | N/A | ~2 seconds for 1GB |
Resize event storms | Exponential growth | Debounced |
/api/sessions/:id/stream
response size/buffers
for binary updatesfwd.ts
bypasses sendExistingContent()