Commit Graph

10 Commits

  • feat(tui,coding-agent): add OSC 9;4 terminal progress indicators
    Emit OSC 9;4 progress start/end sequences during agent streaming and
    compaction so terminals (iTerm2, WezTerm, Windows Terminal, Kitty, etc.)
    show activity in their tab bar.
    
    Made with love for @lucasmeijer
  • fix(tui): sync test awaits with throttled render pipeline (#3076)
    Tests assumed renders complete synchronously after requestRender() +
    nextTick + flush(), but commit 6f5f37f8 changed requestRender() to
    schedule via setTimeout with a 16ms minimum interval. Tests reading
    viewport state before doRender() runs saw stale data.
    
    Add VirtualTerminal.waitForRender() helper that waits for the throttled
    render to settle (nextTick + 20ms + xterm flush), and replace all
    terminal.flush() calls after render-triggering actions with it.
    
    Fixes 8 failing tests across overlay-short-content, tui-render, and
    markdown test suites.
  • fix(tui): drain stdin on exit to avoid Kitty release leak
    Drain stdin for up to 1s after disabling Kitty protocol so in-flight key
    release events are consumed before the shell regains control.
    
    Fixes #1204
  • fix(tui): drain Kitty key release events before exit to prevent SSH leak
    Adds Terminal.prepareForExit() to disable Kitty protocol and wait for
    in-flight release events before fully stopping. This prevents escape
    sequences from leaking to the parent shell over slow SSH connections.
    
    Fixes #1204
  • feat(tui): query Kitty keyboard protocol support before enabling
    - Query terminal with CSI ? u before enabling Kitty protocol
    - Only enable protocol if terminal responds (100ms timeout)
    - Mode-aware key parsing: when Kitty active, interpret legacy
      sequences as custom terminal mappings (e.g. \x1b\r = shift+enter)
    - Add Terminal Setup section to README with Ghostty/wezterm config
    
    fixes #439
  • Add terminal title support to TUI framework (#407)
    Add setTitle() method to Terminal interface for setting window title.
    Uses standard OSC escape sequence \x1b]0;...\x07 for broad terminal
    compatibility (macOS Terminal, iTerm2, Kitty, WezTerm, Ghostty, etc.).
    
    Changes:
    - Add setTitle(title: string) to Terminal interface
    - Implement in ProcessTerminal using OSC sequence
    - Implement no-op in VirtualTerminal for testing
    - Use in interactive mode to set title as "pi - <dirname>"
  • Fix terminal rendering and add improvements
    - Enable bracketed paste mode for handling large pastes
    - Fix editor duplicate line rendering bug at terminal width
    - Add padding support to Markdown component (paddingX/Y)
    - Add Spacer component for vertical spacing
    - Update chat-simple with spacers between messages
  • Add minimal TUI rewrite with differential rendering
    - New TUI implementation with 3-strategy differential rendering
    - Synchronized output (CSI 2026) for flicker-free updates
    - New components: Editor, Markdown, Loader, SelectList, Spacer
    - Editor: file autocomplete, slash commands, large paste markers
    - Markdown: RGB background colors, caching
    - Terminal: cursor movement, visibility, clear operations
    - Chat demo with color-coded messages
  • Massive refactor of API
    - Switch to function based API
    - Anthropic SDK style async generator
    - Fully typed with escape hatches for custom models
  • tui-double-buffer: Implement smart differential rendering with terminal abstraction
    - Create Terminal interface abstracting stdin/stdout operations for dependency injection
    - Implement ProcessTerminal for production use with process.stdin/stdout
    - Implement VirtualTerminal using @xterm/headless for accurate terminal emulation in tests
    - Fix TypeScript imports for @xterm/headless module
    - Move all component files to src/components/ directory for better organization
    - Add comprehensive test suite with async/await patterns for proper render timing
    - Fix critical TUI differential rendering bug when components grow in height
      - Issue: Old content wasn't properly cleared when component line count increased
      - Solution: Clear each old line individually before redrawing, ensure cursor at line start
    - Add test verifying terminal content preservation and text editor growth behavior
    - Update tsconfig.json to include test files in type checking
    - Add benchmark test comparing single vs double buffer performance
    
    The implementation successfully reduces flicker by only updating changed lines
    rather than clearing entire sections. Both TUI implementations maintain the
    same interface for backward compatibility.