Overview
| Comment: | Harden the terminal interface after review
Quitting or pressing Esc again while a request will not stop now escalates from SIGINT to SIGTERM to SIGKILL instead of hanging; a terminated or crashed interface cancels its running request and puts the terminal back; a request that exits without its events is reported. A run is settled when the child exits, not when its output closes. Children run detached from the terminal and get none of the interface's descriptors. Text is sanitized before it reaches the screen: only colour escapes survive, other escapes and control characters are dropped. A streamed reply is committed early only by whole lines, so a resize cannot duplicate or lose text, and a cut-off reply that had lines committed says so. Split key sequences on slow links are kept for the rest; the renderer redraws fully after a resize even when output was committed first. The interface's unit tests run under Fil-C too. |
|---|---|
| Timelines: | family | ancestors | descendants | both | tui |
| Files: | files | file ages | folders |
| SHA3-256: |
fc4294d0eafd12516d2e591ab92deccb |
| User & Date: | dmestas on 2026-11-19 13:19:32.192 |
| Other Links: | branch diff | manifest | tags |
Context
|
2026-11-19
| ||
| 13:34 | CI green on fc4294d0eafd; Fil-C pass check-in: ad4310396c user: dmestas tags: trunk | |
| 13:19 |
Harden the terminal interface after review
Quitting or pressing Esc again while a request will not stop now escalates from SIGINT to SIGTERM to SIGKILL instead of hanging; a terminated or crashed interface cancels its running request and puts the terminal back; a request that exits without its events is reported. A run is settled when the child exits, not when its output closes. Children run detached from the terminal and get none of the interface's descriptors. Text is sanitized before it reaches the screen: only colour escapes survive, other escapes and control characters are dropped. A streamed reply is committed early only by whole lines, so a resize cannot duplicate or lose text, and a cut-off reply that had lines committed says so. Split key sequences on slow links are kept for the rest; the renderer redraws fully after a resize even when output was committed first. The interface's unit tests run under Fil-C too. closed check-in: fc4294d0ea user: dmestas tags: tui | |
| 13:09 |
Add a terminal interface: plain pic in a terminal
A module in the pic binary (src/tui) that runs each request as a child pic --json process and knows it only through its events, so a fault in the interface cannot touch a run. Finished output is committed once to the terminal's scrollback; a small live area (the reply being streamed, a running tool call, status, queued messages, the editor and a footer with the directory, conversation, tokens, context and model) is redrawn from its first changed line, inside synchronized output. A reply that fails mid-stream only ever lived in the live area and simply goes away. Editor: multi-line, history, bracketed paste with large pastes shown as atomic markers. Keys: Enter sends (queues while a reply runs), Ctrl+J or Alt+Enter adds a line, Esc interrupts, Ctrl+C clears and twice quits, Ctrl+D quits, Ctrl+O expands later tool output. Commands: new, resume with a picker, name, fork, compact, model, help, quit; commands typed during a reply wait for it. pic tui -c continues the latest conversation and shows its history; pic chat remains the plain prompt. For clients, agent_start now carries the conversation, model and context window and message_end the usage; the conversation list and a conversation's entries are available as JSON. Tested with unit tests for the width, key, render and editor modules and end to end on a pseudo-terminal. check-in: cb2ad5fbe9 user: dmestas tags: tui | |