Merge branch 'worktree-agent-a2220433c67c864f1'

This commit is contained in:
2026-11-26 00:57:20 +00:00
24 changed files with 2788 additions and 15 deletions
@@ -113,8 +113,12 @@ class ChatShellTerminalSession {
}
/// Draws [run]'s held output from scratch: on open, after a gap and after
/// a readback replaced the card's copy. Answers the emulator gives to old
/// queries in that output are not sent: the process asked them long ago.
/// a readback replaced the card's copy. A machine terminal's read from
/// before the server's tail is the server's snapshot
/// ([ChatShellRun.snapshot]), which resets the emulator and restores the
/// screens, scrollback, cursor and modes; it is drawn the same way.
/// Answers the emulator gives to old queries in that output are not sent:
/// the process asked them long ago.
/// A large output is drawn in slices across turns of the event loop
/// (ChatShellTerminalFeed), so it never stalls the UI.
void replay(ChatShellRun run) {
@@ -126,6 +130,9 @@ class ChatShellTerminalSession {
terminal.useMainBuffer();
terminal.buffer.clear();
terminal.buffer.setCursor(0, 0);
// A full reset (RIS): modes a program set in the output drawn before
// (mouse reporting, bracketed paste, the alternate screen) end too.
terminal.write('\x1bc');
terminal.setCursorVisibleMode(true);
terminal.write('\x1b[0m');
if (run.truncated) {