Files
codex/codex-rs/tui/src/copy_input_guard.rs
T
Benjamin Carlsson c536ffcb18 Add keyboard copy selection to the owned transcript (#50434)
## What changed

- Make `/copy` select the latest completed response directly in the owned transcript. Navigate user messages, code blocks, and blockquotes with arrow keys or `j`/`k`, use `g`/`G` to jump to the ends, and press Enter to copy or Escape to close.
- Highlight selected blocks and keep surrounding context visible during navigation and resizing. Preserve source payloads for code and quotes, including rendered Mermaid diagrams and fenced Markdown tables.
- Pause queued submissions until copy mode closes, and report clipboard results in the transcript footer.

## Testing

Add tests for copy routing, keyboard navigation, highlighting and resize behavior, source whitespace and line endings, clipboard completion, and queued-input resumption.

GitOrigin-RevId: bd4f58ec17568f95d0e91014e5ddba33ca8bd57c
2026-10-02 21:42:23 +00:00

14 lines
360 B
Rust

//! Keep queued submissions paused until the transcript selector releases its owner.
use crate::app_event::AppEvent;
use crate::app_event_sender::AppEventSender;
#[derive(Debug)]
pub(crate) struct CopyInputGuard(pub(crate) AppEventSender);
impl Drop for CopyInputGuard {
fn drop(&mut self) {
self.0.send(AppEvent::TranscriptCopyClosed);
}
}