Terminal manager — PTY sessions via portable-pty #10
Labels
No labels
area:config
area:contracts
area:engine
area:eventsourcing
area:frontend
area:git
area:ipc
area:persistence
area:provider
area:scaffold
area:terminal
type:user-story
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/peon#10
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?
User story
As a user, I want forge-agent to manage PTY terminal sessions (open, write, resize, close) per thread, streaming output to the frontend and keeping a replay buffer for reconnection, so that I have a fully functional embedded terminal.
Acceptance criteria
TerminalManager (
terminal/manager.rs)DashMap<Uuid, TerminalSession>andbroadcast::Sender<AppEvent>open(thread_id, working_dir, cols, rows) -> Result<Uuid>— spawns a PTY viaportable_pty::native_pty_system(), runs$SHELL(fallback/bin/bash) withTERM=xterm-256colorandCOLORTERM=truecolortokio::task::spawn_blockingreader that:AppEvent::TerminalOutput { terminal_id, data }write(terminal_id, data) -> Result<()>— writes bytes to the PTY masterresize(terminal_id, cols, rows) -> Result<()>— callsmaster.resize()snapshot(terminal_id) -> Result<Vec<u8>>— returns the history buffer for replayclose(terminal_id) -> Result<()>— kills the child process and removes the sessionTerminalSession struct
id,thread_id,pair(PtyPair),writer,status: TerminalStatus,history: Vec<u8>Kitty/Foot external mode
open_kitty_tab(working_dir, title) -> Result<()>— launches a Kitty tab viakitty @ launch --type=tabopen_foot_window(working_dir) -> Result<()>— launchesfootwith--working-directory$KITTY_PIDenv var for Kitty,which footfor FootAppConfig.terminal.modeCommand routing
TerminalCommandvariants from IPC (Open, Write, Resize, Close, Restart)Tests
Out of scope
References
Dependencies
TerminalCommandvariants come from #6 but can be stubbed and wired later.issue-3-config