codex - 💡(How to fix) Fix Mouse drag selection + copy in the TUI [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19820Fetched 2026-04-28 06:36:34
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×3unlabeled ×1

Add mouse drag selection support to the Codex TUI so users can select text from both the output area and the input composer, automatically copy the selected text to the clipboard, and show a short Copied to Clipboard notification.

Error Message

  • Copy part of an error message.

Root Cause

Add mouse drag selection support to the Codex TUI so users can select text from both the output area and the input composer, automatically copy the selected text to the clipboard, and show a short Copied to Clipboard notification.

Fix Action

Fix / Workaround

Would the Codex team be open to this behavior? If so, I’d be happy to clean up the patch and submit a PR if invited.

RAW_BUFFERClick to expand / collapse

What variant of Codex are you using?

CLI

What feature would you like to see?

Summary

Add mouse drag selection support to the Codex TUI so users can select text from both the output area and the input composer, automatically copy the selected text to the clipboard, and show a short Copied to Clipboard notification.

Motivation

When reviewing generated output, commands, paths, errors, or pasted prompt text, it is useful to quickly select and copy text directly from the TUI. Today, copying text from terminal applications can be inconsistent, especially when mouse capture, alternate screen behavior, scrollback, and input widgets are involved.

This would make common workflows smoother:

  • Copy a command or file path from assistant output.
  • Copy part of an error message.
  • Copy selected text from the input composer before submitting.
  • Select partial lines rather than only whole rows.

Proposed behavior

<img width="1449" height="861" alt="Image" src="https://github.com/user-attachments/assets/077591fb-52dc-42c7-a467-e02900ac32a3" />
  • Enable mouse drag selection in the TUI.
  • Allow selection in the output/history area.
  • Allow selection in the input composer area.
  • Support partial-line and multi-line selections.
  • On mouse release, copy selected non-empty text to the clipboard.
  • Show a Copied to Clipboard notification after a successful copy.
  • Show a copy failure message if clipboard access fails.
  • Make the selected region visibly highlighted while dragging.

Additional information

I have a local prototype that implements this behavior in codex-rs/tui, including focused tests for:

  • mouse event mapping,
  • partial single-line selection,
  • partial multi-line selection,
  • output/history selection,
  • input composer selection,
  • visible selection highlighting.

Would the Codex team be open to this behavior? If so, I’d be happy to clean up the patch and submit a PR if invited.

Here is my prototype: https://github.com/hamsar4j/codex/tree/feat/select-to-copy

extent analysis

TL;DR

The proposed solution involves implementing mouse drag selection support in the Codex TUI to enable users to select and copy text from both the output area and the input composer.

Guidance

  • Review the provided prototype at https://github.com/hamsar4j/codex/tree/feat/select-to-copy to understand the proposed implementation.
  • Test the prototype to verify that it meets the required functionality, including mouse event mapping, partial single-line selection, and visible selection highlighting.
  • Evaluate the compatibility of the prototype with different terminal applications and environments to ensure consistent behavior.
  • Consider the security implications of automatically copying selected text to the clipboard and provide appropriate error handling for clipboard access failures.

Example

No code snippet is provided as the issue does not contain specific code references.

Notes

The proposed solution is a feature request, and its implementation may depend on the Codex team's priorities and requirements. The provided prototype serves as a starting point for discussion and potential development.

Recommendation

Apply workaround: The proposed solution is a new feature, and its implementation may take time. In the meantime, users can use existing terminal copy-paste functionality or third-party tools to achieve similar results, although with less convenience.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING