Skip to content

feat(tui): handle paste in session picker#23338

Merged
fcoury-oai merged 4 commits into
mainfrom
fcoury/paste-in-session-picker
May 18, 2026
Merged

feat(tui): handle paste in session picker#23338
fcoury-oai merged 4 commits into
mainfrom
fcoury/paste-in-session-picker

Conversation

@fcoury-oai
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai commented May 18, 2026

Why

The session picker already supports typed search, but it ignored bracketed paste events entirely. On macOS terminals this makes pasted text look like a no-op on the resume screen, which is especially noticeable when a user wants to paste part of a thread name, branch, or path into the search field.

What Changed

  • route TuiEvent::Paste(String) into the session picker instead of dropping it
  • normalize pasted search text into a single-line query by collapsing whitespace
  • ignore whitespace-only pastes
  • reuse the existing set_query(...) path so pasted searches keep the same filtering and pagination behavior as typed input
  • add focused tests for append behavior, whitespace normalization, whitespace-only paste, and the existing search-loading path

This PR is stacked on top of #23234 and contains only the net change relative to etraut/clarify-resume-hints.

How to Test

  1. Start Codex in a terminal that emits bracketed paste, for example iTerm2 on macOS.
  2. Open the resume picker so the search UI is visible.
  3. Copy a term that should match one of the visible sessions, then paste it into the picker.
  4. Confirm the query updates immediately and the list filters as if the text had been typed.
  5. Also verify that pasting text with newlines or tabs still produces a usable single-line search query.
  6. Also verify that normal typed search still works and that Esc still clears the query / exits as before.

Targeted tests:

  • cargo test -p codex-tui

@fcoury-oai fcoury-oai changed the title fix(tui): handle paste in session picker tui: handle paste in session picker May 18, 2026
@fcoury-oai fcoury-oai changed the title tui: handle paste in session picker feat(tui): handle paste in session picker May 18, 2026
Copy link
Copy Markdown
Contributor

@canvrno-oai canvrno-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing by pasting test into the /resume search, worked as expected.

Base automatically changed from etraut/clarify-resume-hints to main May 18, 2026 18:32
@fcoury-oai fcoury-oai enabled auto-merge (squash) May 18, 2026 18:50
@fcoury-oai fcoury-oai merged commit 8e52578 into main May 18, 2026
31 checks passed
@fcoury-oai fcoury-oai deleted the fcoury/paste-in-session-picker branch May 18, 2026 19:04
@github-actions github-actions Bot locked and limited conversation to collaborators May 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants