mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
Add configurable right-click paste to the fullscreen TUI (#48118)
## What changed - Add `tui.right_click_paste` with `auto`, `on`, and `off` modes. The default `auto` enables the fallback on Windows and Linux, including WSL when terminal detection is conclusive. `on` also enables macOS. Both modes skip SSH sessions and recognized VS Code terminals. - Paste clipboard text through the normal composer input path when no selection, search, or blocking view takes precedence. Discard pending results after intervening input, focus loss, or changes to the target thread, draft, or cursor. - Read text asynchronously through the shared clipboard worker, with a five-second deadline and the message size limit. Read the Windows clipboard through PowerShell on WSL and reject overlapping clipboard operations. ## Testing Add coverage for platform and terminal policy, normal paste delivery, stale reads, overlapping clipboard operations, read timeouts, oversized text, and large command output. GitOrigin-RevId: 0a7b6d445c09928da6c5335841ba2a9a66cc7e4b
This commit is contained in:
@@ -1271,6 +1271,7 @@ fn config_toml_deserializes_model_availability_nux() {
|
||||
raw_output_mode: false,
|
||||
fullscreen_transcript: true,
|
||||
copy_on_select: Default::default(),
|
||||
right_click_paste: Default::default(),
|
||||
alternate_screen: AltScreenMode::default(),
|
||||
status_line: None,
|
||||
status_line_use_colors: true,
|
||||
@@ -4412,6 +4413,7 @@ fn tui_config_missing_notifications_field_defaults_to_enabled() {
|
||||
raw_output_mode: false,
|
||||
fullscreen_transcript: true,
|
||||
copy_on_select: Default::default(),
|
||||
right_click_paste: Default::default(),
|
||||
alternate_screen: AltScreenMode::Auto,
|
||||
status_line: None,
|
||||
status_line_use_colors: true,
|
||||
|
||||
@@ -792,6 +792,9 @@ pub struct Config {
|
||||
/// Override the terminal-specific default for copying transcript mouse selections.
|
||||
pub tui_copy_on_select: codex_config::types::CopyOnSelect,
|
||||
|
||||
/// Right-click text paste fallback for the fullscreen TUI.
|
||||
pub tui_right_click_paste: codex_config::types::RightClickPaste,
|
||||
|
||||
/// Start the TUI in the specified collaboration mode (plan/default).
|
||||
|
||||
/// Controls whether the TUI uses the terminal's alternate screen buffer.
|
||||
@@ -4498,6 +4501,11 @@ impl Config {
|
||||
.as_ref()
|
||||
.map(|tui| tui.copy_on_select)
|
||||
.unwrap_or_default(),
|
||||
tui_right_click_paste: cfg
|
||||
.tui
|
||||
.as_ref()
|
||||
.map(|tui| tui.right_click_paste)
|
||||
.unwrap_or_default(),
|
||||
tui_alternate_screen: cfg
|
||||
.tui
|
||||
.as_ref()
|
||||
|
||||
Reference in New Issue
Block a user