Conversation
Phase 1-3 of terminal cards implementation: - terminal crate: Wraps alacritty_terminal (Apache-2.0) as a GPUI entity with PTY and display-only modes, event processing, content snapshots - terminal_view crate: GPUI Element that renders the terminal cell grid with full ANSI color support, embedded/scrollable modes - Integration: ExecuteCommandOutputRenderer feeds command output into a display-only terminal for rich rendering with colors The renderer uses the existing ToolOutputRendererRegistry pattern, creating display-only Terminal entities that process ANSI escape codes via alacritty's VTE parser and render styled cells via GPUI's text system. Branch: feature/terminal-cards
Replace DefaultCommandExecutor with GpuiTerminalCommandExecutor in the GPUI UI so that execute_command tool invocations run inside real PTY terminals. Terminal output appears as live cards in the chat with full ANSI color rendering, a header showing the command and status, colored borders (gray=running, green=success, red=error), and collapse/expand. New files: - terminal_pool.rs: global pool of Entity<Terminal> keyed by terminal_id with a (session_id, tool_id) -> terminal_id secondary index - terminal_executor.rs: GpuiTerminalCommandExecutor using a worker/channel bridge to create PTY terminals on the GPUI foreground thread; each command runs as an independent task for concurrency; falls back to DefaultCommandExecutor if the worker is unavailable Modified files: - terminal_output_renderer.rs: rewritten to prefer live PTY terminals from the pool, falling back to display-only terminals for session restoration from persistence - mod.rs: register terminal worker at startup, handle ToolTerminal fragments to store tool_id -> terminal_id mappings - app/gpui.rs, backend.rs: inject GpuiTerminalCommandExecutor - ui_events.rs: add ToolTerminalAttached event variant - acp/ui.rs: handle new event variant (no-op for ACP)
…d state - Switch font from Berkeley Mono to Menlo (system monospace, always available on macOS) — fixes wide character spacing - Add Terminal::content_lines() that counts lines with actual content (cursor position + scrollback) instead of total grid rows - Use content_lines() in TerminalView::content_mode() so cards grow dynamically as output appears rather than starting at max height - Reduce max_lines_when_unfocused from 1000 to 50 for a reasonable card height that stays in Inline mode - Fix UTF-8 panic in terminal_executor: switch delta tracking from byte offsets to character counts, avoiding slicing inside multi-byte characters when get_content_text() content shifts between reads - Keep tools with custom output renderers (execute_command, spawn_agent) expanded after completion so terminal cards remain visible
- Remove the terminal card's own header and collapse toggle (the tool block already provides these) - Remove the card border (tool block has its own visual framing) - Make execute_command's command_line parameter full-width so long commands display properly instead of being truncated in the header - Clean up dead code (collapse state, card helper functions, unused imports)
…border" This reverts commit 4ed9480.
Terminal cards...
Fixes fallback for detecting finished terminals via timeout
Fixes glaring markdown inline code spens
- inline tools not animating - a bug when expanding thinking blocks (flashing at full height for one frame)
Replacement versus append. Fixes unified diffs in the new diff cards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.