mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
Honor tmux mouse changes while the TUI is in alternate screen (#63195)
## Why tmux doesn't notify panes when its `mouse` option changes. Codex read the option on screen entry, so toggling it while an alternate screen was open could leave mouse capture out of step with the tmux setting. ## What changed Poll the containing tmux session's `mouse` option in the background while the alternate screen is active. Redraw on changes, even when the TUI is idle, and reapply mouse capture for the current screen, including nested screens such as `/resume`. When tmux turns mouse capture off, discard queued mouse events and end active drags and pending clicks while preserving selected text. ## Testing Cover idle redraws on mouse changes, stale and failed probes, capture updates across fullscreen and overlay modes, and late releases after capture ends. GitOrigin-RevId: a502a5e78bbc887adfe080ba2da4dbe8910f2420
This commit is contained in:
@@ -857,6 +857,11 @@ impl TranscriptView {
|
||||
}
|
||||
|
||||
pub(crate) fn tick_selection(&mut self, cells: &[Arc<dyn HistoryCell>]) -> bool {
|
||||
// A lost release can strand a Back to bottom press even without a text selection.
|
||||
if crate::tui::tmux_mouse_disabled() {
|
||||
self.end_drag();
|
||||
return false;
|
||||
}
|
||||
let snapshot = self.snapshot_cells();
|
||||
let cells = snapshot.as_deref().unwrap_or(cells);
|
||||
let Some(selection) = self
|
||||
|
||||
Reference in New Issue
Block a user