Run chat shell commands in a pseudo-terminal with typed input and resize

Commands start in a PTY (creack/pty; macOS and Linux) of the client's size
with TERM=xterm-256color in their own session. chat_shell_input writes typed
UTF-8 text in order through a bounded queue; chat_shell_resize sets the size.
Output stays the raw terminal stream with byte offsets as sequence numbers,
chat_shell_run_output resumes from an offset, and a plain-text rendering is
persisted for Copy output and Send to agent. Input is never stored or logged.
This commit is contained in:
2026-11-09 19:57:46 +00:00
parent 8ca5a1fdda
commit 355b722a1d
20 changed files with 865 additions and 54 deletions
+2 -1
View File
@@ -255,7 +255,8 @@ func handleChat(ctx context.Context, request protocol.Message, broker chatBroker
case protocol.ChatShellOutput:
handleChatShellOutput(ctx, request, broker, registry, write)
return true
case protocol.ChatShellRun, protocol.ChatShellStop, protocol.ChatShellRuns, protocol.ChatShellRunOutput, protocol.ChatShellShare:
case protocol.ChatShellRun, protocol.ChatShellStop, protocol.ChatShellRuns, protocol.ChatShellRunOutput, protocol.ChatShellShare,
protocol.ChatShellInput, protocol.ChatShellResize:
handleChatShellRunRequest(ctx, request, broker, hub, registry, clientID, write)
return true
case protocol.ChatAttachmentImage: