Skip to content

Fullscreen composer draft selections do not honor copy_on_select on mouse release #51970

Closed

Description

@toppk

Summary

In the CLI's fullscreen TUI, mouse selection in the editable composer does not follow the copy-on-select behavior used for transcript output. With tui.copy_on_select = "always", releasing a nonempty transcript selection copies it to CLIPBOARD, but releasing a nonempty draft-text selection does not. Draft text still requires an explicit copy shortcut or right-click.

Please apply the configured selection-copy policy consistently to draft text. The primary case here is automatic CLIPBOARD publication on mouse release, not middle-click paste or the availability of X11 PRIMARY under Wayland.

Environment and verification

  • Installed CLI: codex-cli 0.161.0.
  • Terminal: Revenant, an X11 terminal running through Xwayland on Linux; terminal mouse reporting enabled; fullscreen TUI.
  • Source inspected: main at e974aad3b1a8f144273e882c614aefe69eaef615.
  • This report combines the user's draft-selection/copy complaint with source inspection. The controlled steps below are a proposed reproduction, not an automated end-to-end clipboard test. The source supports highlighting/editing draft selections; the confirmed implementation gap reported here is missing automatic copying on release, rather than a claim that draft highlighting is universally broken.

Reproduction

  1. Start Codex in Fullscreen mode with tui.copy_on_select = "always". Leave application mouse reporting enabled.
  2. Copy an unrelated marker into the system CLIPBOARD.
  3. Type an unsent draft, then left-drag over a nonempty range of its text and release, without modifiers. Do not press a copy shortcut or right-click.
  4. Paste CLIPBOARD into another application's text field using its explicit clipboard-paste action.
  5. Compare with selecting transcript output under the same settings. Transcript selection copies on release; draft selection has no corresponding automatic-copy path.

The CLIPBOARD comparison deliberately avoids middle-click/PRIMARY ambiguity. It can also be reproduced in a pure X11 session, or with WAYLAND_DISPLAY unset for Codex, so fixing the Wayland eligibility check does not fix this omission.

Expected behavior

With copy_on_select = "always", releasing a nonempty draft selection should copy that selected text to CLIPBOARD, preserving the draft and applying the same selection-retention and copy-delivery feedback rules as automatic transcript copying. never should suppress that automatic CLIPBOARD write; auto should follow the same terminal policy used for the transcript. Empty selections should not overwrite the clipboard.

There is a related consistency gap for eligible local X11 sessions: transcript selection also publishes plain text to PRIMARY independently of explicit clipboard copying, while draft selection has no analogous publication. That should be considered when sharing selection policy between the two surfaces, but this report's CLIPBOARD reproduction does not require PRIMARY support.

Implementation evidence and underlying PRs

  • #46858 introduced mouse selection/editing and explicit copying in the fullscreen composer.
  • #47639 introduced configurable copy-on-select, explicitly scoped to transcript selections. This report asks to close the draft/transcript inconsistency; it does not claim that PR promised draft support or that a later change removed it.
  • #49112 added PRIMARY publication for transcript selections and PRIMARY paste into the composer, but not publication from draft selections.
  • In transcript_view/input.rs, releasing a left-button selection produces CopyOnSelect when configured, or PrimarySelection when available.
  • In chat_composer/mouse.rs, copy_selection() requests copying only for a copy key or right-button press. handle_mouse() updates the textarea, cursor following, attachments, and popups without automatic selection publication.
  • textarea/mouse.rs ends the drag on left-button release but does not copy it; app/owned_transcript.rs consumes handled composer gestures before transcript copy-on-select dispatch.

Related issues reviewed; why this is distinct

  • #49162 and #48044: PRIMARY/middle-click regressions, including the Wayland availability restriction. This report uses explicit CLIPBOARD paste and persists independently of that restriction.
  • #48139: broader Linux shortcut/selection changes. This report isolates automatic copying from the unsent draft, compared with transcript output in the same process.
  • #50132: resolved by setting copy_on_select = "always". Here that setting is explicitly enabled; the draft path does not consult it.
  • #41211 and #20645: adding composer selection/editing itself. That implementation exists now; this report concerns publication after selecting.
  • #44398: an older animation-related failure to select composer text, reported fixed in 0.156.0. This is the missing mouse-release copy path in the current fullscreen composer, irrespective of animations.
  • #48664: a mouse-capture opt-out. Here mouse capture and fullscreen interaction should remain enabled.
  • #49420: disabling right-click copying. Here the missing action is automatic copying on left-button release.
  • #51306: copying in the asynchronous question editor, a different input surface from the ordinary composer draft.
  • #11987: a shortcut to copy the entire draft. Here the requested behavior is automatic copying of the selected range.

Suggested regression coverage: select nonempty draft text and release under always, never, and terminal-resolved auto; verify clipboard publication, retained draft/selection, empty-selection behavior, and failures/unconfirmed delivery. For eligible X11 sessions, compare PRIMARY publication from draft and transcript as well.

Activity

  1. added
    bug
    CLI
    TUI
    on Oct 8, 2026
  2. bradleyklee commented on Oct 8, 2026

    @bradleyklee

    This is part of a bigger broken-workflow issue that may need product-design escalation. Not everyone is signed in at a minimal runlevel. Product design cannot assume that. Whatever defaults fall out of system sensing need to accommodate desktop workflow as well as TTY, and offer an override when sensing gets it wrong.

    Our case is closest to #48664: a Pop!_OS 22.04 LTS desktop running GNOME 42.9 with Mutter and GNOME Terminal, SSH’ed into the control plane running Codex CLI 0.161.0. We typically want userland copy-and-paste—the mouse on the desktop copying to and pasting from the desktop clipboard, across tabs and windows—while retaining fullscreen Codex. -- Mech.An.ika Codex

  3. sai3563 commented on Oct 12, 2026

    @sai3563

    Hello,

    I'm encoutering the same issue in Windows Terminal on Windows and iTerm2 on macOS.

    I set copy_on_select = "always" in Codex so I can copy text in terimal just by selecting it, as I find it more efficient for my workflow.

    I also have "copyOnSelect": true, set in Windows Terminal, to get this behaviour everywhere in Windows Terminal.

    I was surprised to find the Codex prompt input box as the only place where copy on select doesn't work.

    Would request for a way to enable the same.

  4. etraut-openai commented on Nov 9, 2026

    @etraut-openai
    Contributor

    Fixed in #53753 and shipped in Codex CLI 0.164.0.

    With tui.copy_on_select = "always", drag over text in an unsent draft and release the left mouse button. The fullscreen composer now copies the selected text to the clipboard on release, just as the transcript does. The draft stays highlighted so you can type to replace the selection. On X11, the composer also publishes the selection to PRIMARY when enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLITUIbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions