Commit graph

133 commits

Author SHA1 Message Date
b28283bf34
Fix db types 2026-01-31 12:08:23 -05:00
0a17b61bf3
Update docs to reflect deleted ANSI files
Replace reference to deprecated ansi.ts and ansi-carryover.ts
with description of current trimHtmlOutput() functionality.
2026-01-31 12:02:48 -05:00
f2a60658cf
Document xterm HTML structure dependency in trimHtmlOutput
Add warning about dependency on xterm's HTML format and the risk
if xterm changes it. Suggest filing an upstream issue for a native
trimEmpty option.
2026-01-31 12:02:23 -05:00
4502be8d06
Add integration tests for reconnect scenarios
Test that initial_state provides full terminal state, multiple
sessions are independent, and the CSI 'T' artifact bug is fixed.
2026-01-31 12:02:00 -05:00
baa6ef9d70
Delete deprecated ANSI processing files
Remove ansi.ts, ansi-carryover.ts, and their test files. Terminal
emulation is now handled by @xterm/headless via terminal.ts.
2026-01-31 12:01:24 -05:00
6342c7a699
Add error handling to terminal creation
Wrap terminal creation in try-catch to prevent session creation
from failing if the terminal emulator fails to initialize. The
session will still work, just without ANSI processing.
2026-01-31 12:01:07 -05:00
58996a51f8
Add periodic cleanup for orphaned terminals
Every 5 minutes, check for terminals whose sessions have ended
but weren't properly disposed. This handles cases where a server
crash or network issue prevented normal WebSocket close.
2026-01-31 12:00:48 -05:00
22c5c3d102
Fix dashboard race condition in initial_state handler
When a new session's initial_state arrives, we now set the output
before calling renderSessions() rather than after. This prevents
renderSessionOutput() from being called before the DOM exists.
2026-01-31 12:00:23 -05:00
1b72d1e4e4
Trim empty rows 2026-01-31 11:53:38 -05:00
ab61445bcc
Use css for wrapping text 2026-01-31 11:43:56 -05:00
31340fe0a8
Fix async terminal.write() causing garbled dashboard output
The terminal.write() method from @xterm/headless is async - the data
isn't in the buffer yet when we call serializeAsHTML() immediately
after. This caused empty or partially rendered output in the browser.

Now using the callback form of terminal.write(data, callback) to wait
for the write to complete before serializing and broadcasting to SSE
clients. This ensures the terminal buffer is fully updated before we
generate HTML from it.
2026-01-31 11:06:37 -05:00
9bc77292cd
Remove browser resize triggers 2026-01-31 10:58:22 -05:00
116847ab58
Add multiple fixes 2026-01-31 10:14:25 -05:00
0ac5eec30d
Update docs for terminal emulation 2026-01-31 10:04:29 -05:00
6bd599d47b
Fix dashboard to handle terminal serialization output
The server's serializeAsHTML() returns the full terminal screen state, not incremental chunks. Updated the dashboard to:

1. Handle initial_state event to receive current terminal state on connection
2. Replace output instead of appending (output event now replaces session.output)
3. Simplify renderSessionOutput() to always do full innerHTML replacement

This fixes the issue where output was being duplicated/appended incorrectly.
2026-01-31 09:58:18 -05:00
130f01a19f
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.
2026-01-31 09:53:22 -05:00
43648f7d60
Add initial_state SSE event for reconnect sync (Phase 3)
When a dashboard connects via SSE, it now receives the current terminal
state for all active sessions. This allows dashboards to immediately
display the full terminal content without waiting for new output.
2026-01-31 09:51:13 -05:00
88afb7249d
Replace ansiToHtml with terminal serialization (Phase 2)
The output handler now:
- Writes raw data to terminal emulator
- Stores raw data in DB (unchanged)
- Serializes terminal state as HTML
- Broadcasts serialized HTML via SSE

This replaces the ansiToHtml() + splitAnsiCarryover() approach with
proper terminal emulation. The terminal emulator handles all ANSI
sequences internally, including incomplete sequences across chunks.
2026-01-31 09:49:53 -05:00
6c7de2332b
Add terminal.test.ts unit tests 2026-01-31 09:47:54 -05:00
0366e459f5
Integrate terminal emulator in server.ts (Phase 1) 2026-01-31 09:45:38 -05:00
c9908c87c3
Add terminal.ts module for headless terminal emulation
Creates new module providing terminal session management using @xterm/headless:
- createTerminal(): spawn headless terminal emulator instances
- serializeAsHTML(): export terminal state as HTML
- disposeTerminal(): clean up resources

This replaces stateless ANSI processing with proper VT emulation that tracks
cursor position, screen buffer, and terminal attributes across output chunks.
2026-01-31 09:43:46 -05:00
5016cd9960
Add terminal emulation design doc 2026-01-31 09:40:31 -05:00
a14decf2bc
Fix HTML truncation to avoid cutting inside tags 2026-01-31 09:12:20 -05:00
3e5afbd5a8
Clean up ansiCarryovers on WebSocket close 2026-01-31 09:12:05 -05:00
42ba893ea5
Add tests for splitAnsiCarryover function 2026-01-31 09:11:49 -05:00
0a3bfa6092
Add debug logging for ANSI carryover events 2026-01-31 09:10:19 -05:00
c09654c6c7
Add JSDoc to splitAnsiCarryover function 2026-01-31 09:10:07 -05:00
a8eea4e694
Add SSE cleanup 2026-01-31 09:06:16 -05:00
721bff81d0
Cleanup dom 2026-01-31 09:06:08 -05:00
f2c3f6f067
Avoid stray control characters 2026-01-31 09:05:33 -05:00
a8a73aad4e
Add dynamic favicon state system
Embed SVG path data in TypeScript to enable runtime color switching based on app state (idle/processing/error) without maintaining multiple static SVG files.
2026-01-31 08:42:58 -05:00
0df63961e0
Update todo 2026-01-31 08:42:58 -05:00
aeebe863e9
Speed up docker builds 2026-01-31 08:33:40 -05:00
33cf28d643
Add reload to header click 2026-01-30 13:55:34 -05:00
5597502a8c
Keep terminal scrolled to bottom 2026-01-30 13:55:26 -05:00
9e8a275831
Display --yolo instead of --dangerously-skip-permissions 2026-01-30 13:15:45 -05:00
b67247e340
Replace pin button with floating scroll-to-bottom button
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 10:47:47 -05:00
386c1e74cc
Update TODO 2026-01-30 10:14:52 -05:00
423fa8375d
End all sessions on server startup 2026-01-30 09:12:40 -05:00
28920eca1e
Add todo 2026-01-30 08:33:29 -05:00
2dfe420555
Rename project from claude-remote to clarc
Updated all references across documentation, config files, and source code.
2026-01-30 08:32:34 -05:00
97cc975d55
Fix session list disappearing on page refresh
Frontend now fetches existing sessions from /api/sessions when SSE connects.
Previously only listened for session_start events, causing sessions to
disappear after page reload.
2026-01-30 08:26:14 -05:00
f9c521286b
Add --yolo alias for --dangerously-skip-permissions 2026-01-30 08:20:22 -05:00
5948dcaed1
Add viewport-based PTY resize from dashboard 2026-01-30 08:19:09 -05:00
19917ef614
Add an idea 2026-01-30 08:16:39 -05:00
21b8caeb67
Fix carriage return handling to emulate line overwrite 2026-01-30 08:06:36 -05:00
350c352989
Safely kill processes 2026-01-30 07:51:09 -05:00
364e3d909e
Restore terminal to cooked before suspending 2026-01-30 07:47:22 -05:00
766ae27fee
Resume the child process first 2026-01-30 07:46:41 -05:00
d5194ede9e
Send a redraw 2026-01-30 07:44:53 -05:00