forked from geomind_code/zinit_archive2
terminal works but not good enough #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
need colors
also need to make sure mouse can be used? is send to terminal
also the dropdown doesn't work properly to select job which us running
also need right mouse on job, to get terminal
also need route so its terminal/$jobid...
os we can right away jump to it
not good
Implementation Spec for Issue #9 — Terminal Improvements
Objective
Improve the terminal tab in the HeroProc dashboard to provide full color support, mouse input forwarding, a working job selector dropdown, right-click "Open Terminal" on jobs, and deep-link routing via
#terminal/{jobid}.Root Causes Found
TERM=xterm-256color— programs default to dumb terminal_term.onBinary()not wired up — xterm.js needs it for mouse escape sequencespopulatePtyServiceList()callsservice.listand iterates withObject.keys()incorrectly#terminal/...hash route supportFiles to Modify
crates/hero_proc_server/src/supervisor/executor.rs— Set TERM/COLORTERM env vars for PTY jobscrates/hero_proc_server/src/web.rs— Add/api/jobs/{id}/ptyWebSocket endpointcrates/hero_proc_ui/src/routes.rs— Add job PTY proxy route + terminal SPA routecrates/hero_proc_ui/templates/index.html— Fix terminal tab: dropdown, mouse, deep-linkcrates/hero_proc_ui/static/js/dashboard.js— Terminal routing, context menu itemscrates/hero_proc_ui/static/css/dashboard.css— Terminal container sizingImplementation Plan
Step 1: Set TERM env vars (server) — no deps
Set
TERM=xterm-256colorandCOLORTERM=truecolorinexecutor.rsfor PTY jobs.Step 2: Add job-based PTY endpoint (server) — no deps
New route
/api/jobs/{id}/ptythat looks up PTY handle by job_id directly.Step 3: Add job PTY proxy route (UI) — depends on Step 2
Proxy
/api/jobs/{id}/ptyWebSocket to server, add/terminal/{rest}SPA route.Step 4: Fix terminal tab JS (UI) — depends on Step 3
Rewrite dropdown to list running jobs, fix attach to use job-based endpoint, add
onBinaryfor mouse.Step 5: Terminal deep-link routing (UI) — depends on Step 4
Handle
#terminal/{jobId}in hashchange, auto-attach on navigation.Step 6: "Open Terminal" context menus (UI) — depends on Step 4
Add Terminal option to job/service right-click menus.
Step 7: CSS adjustments — no deps
Ensure terminal container fills space properly.
Acceptance Criteria
#terminal/42deep-links to job 42's terminal#terminal/{jobId}when attachedImplementation Complete — Terminal Improvements
Changes Made
Server (
hero_proc_server)executor.rs— SetTERM=xterm-256colorandCOLORTERM=truecolorenv vars for PTY jobs (enables color output)web.rs— Added/api/jobs/{id}/ptyWebSocket endpoint for direct job-based PTY attachUI Proxy (
hero_proc_ui)routes.rs— Added/api/jobs/{id}/ptyproxy route +/terminal/{rest}SPA routeFrontend
index.html— Rewrote terminal tab: job-based dropdown,attachToJob(), mouse support viaonBinarydashboard.js— Added#terminal/{jobId}deep-link routing, "Open Terminal" in right-click context menusdashboard.css— Terminal container flex layout for proper sizingTest Results
hero_proc_server: 55 passed, 0 failedhero_proc_ui: compiles clean (no unit tests)Acceptance Criteria Status
#terminal/{jobId}deep-link routing worksImplementation committed:
c88c7b4Browse:
c88c7b4