Repository navigation
Overhaul Terminal UX #10499
QarthO
started this conversation in
Improvement Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Currently the terminal UX is a bit lacking. Most notable is the connection dropping and killing the terminal session completely. Currently there is a "reconnected" feature added but its very poorly made and it doesnt reset state prooperly, and often gets stuck in a loop. IMO, This is just the wrong approach to handle this.
My idea is that the terminal session be handled 100% serverside, and the browser just replays the terminal visually, and records keystrokes. This way the browser is independent and the page or tab can be reloaded and the terminal session doesn't get killed or lost. This would also allow the user to be able to swap browsers, or even devices and not loose their terminal session. The session could be handled inside of the
coolify-realtimecontainer and live in memory.I spent some time working with codex to give a rough plan. Here's what it came up with:
Simplified Terminal Persistence Plan
Summary
Keep terminal sessions in memory inside the realtime service. The browser becomes an attach/detach client only. If the realtime service restarts, live terminal sessions are lost; that is acceptable.
Build on the recent upstream work: keep their WebSocket heartbeat, visibility reconnect handling, 8-hour session cap, terminal utilities, Livewire keepalive, scrollback preservation, and mobile controls. Replace only the parts that still tie PTY lifetime to one browser connection.
Goal
A terminal session should survive:
A terminal session does not need to survive:
coolify-realtimerestartCore Change
Move terminal ownership from the browser socket to the realtime process.
Today:
Target:
Realtime Session State
Store live sessions in memory only.
Each session contains:
Browser Protocol
Use explicit message types:
list: return live sessions owned by this user/teamcreate: validate and start a new terminal sessionattach: attach this socket to an existing sessiondetach: disconnect this browser without killing the PTYterminate: explicitly kill the PTYinput: send keystrokesresize: update terminal dimensionsping: keepaliveOnly
terminate, PTY exit, expiry, or realtime restart should end a session.Laravel Role
Laravel stays responsible for trust decisions.
Laravel should provide:
The browser should no longer receive raw SSH commands. The realtime service asks Laravel for the launch command after Laravel validates the requested target.
Browser Role
The browser should only:
Preserve Upstream Improvements
Keep the new upstream work unless it directly conflicts:
Change the “replay last command after reconnect” behavior: it should not be the normal resume mechanism anymore. Resume should attach to the existing PTY. Command replay can be removed or kept only as a fallback for startup races before a session is created.
Security Rules
Acceptance Criteria
cd /tmp, reload, thenpwdstill returns/tmp.Test Scenarios
All reactions