You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ctrl+V in TUI is image-only when it reaches Codex as a key event; add symmetric text paste #17103
In the TUI, Ctrl+V currently behaves as an image-paste shortcut if it reaches Codex as a key event.
That means when the clipboard contains text, and the terminal does not convert the paste into a bracketed Paste(...) event, Codex tries to
paste an image instead and shows an error like:
Failed to paste image: no image on clipboard: ...
Root cause
There are currently two different paste paths:
text paste: relies on terminal/crossterm Event::Paste(...)
Ctrl+V: handled as clipboard image paste in the TUI keybinding layer
So if the terminal forwards Ctrl+V as a keypress instead of surfacing a paste event, text paste does not happen inside Codex.
Proposed behavior
Ctrl+V in local desktop sessions:
try clipboard text first
if non-empty text exists, route it through the existing composer paste path
if no text exists, fall back to image paste
Alt+V:
remain explicit image paste
SSH/remote sessions:
do not do process-local text clipboard reads
rely on terminal-owned paste
if Ctrl+V reaches Codex as a key event, show a short hint instead of reading the remote process clipboard
Why this shape
preserves terminal-native Paste(...) handling
preserves explicit image paste
avoids incorrect clipboard semantics in SSH sessions
makes Ctrl+V symmetric for local users whose terminal forwards the keypress
Local implementation + verification
I implemented this in a local clone and verified with:
just fmt
cargo clippy -p codex-tui --tests
cargo test -p codex-tui
The change includes:
text clipboard read helper
WSL text fallback
Ctrl+V text-first shortcut policy
Alt+V image-only policy
SSH hint path
updated footer/snapshots/tests
If this approach matches the intended direction, I can turn it into a PR if invited.
This root-cause explanation matches another real-world reproduction path.
In a Windows remote-control setup using UU remote connection + WezTerm, plain text paste can fail with the image-paste error:
Failed to paste image: no image on clipboard...
The user is not pasting an image. The likely sequence is:
Text is copied locally / into the remote Windows clipboard.
The remote-control client forwards Ctrl+V as raw key events.
WezTerm does not convert that particular input path into a terminal paste event.
Codex receives raw Ctrl+V.
The TUI handles it as image paste and reports that no image is on the clipboard.
The same machine had a working text-paste path in traditional cmd.exe via mouse right-click paste, which suggests the text clipboard can be fine and the failure depends on whether the terminal consumes the paste shortcut or passes Ctrl+V through to Codex.
Workarounds that avoid the issue:
Use Ctrl+Shift+V or Shift+Insert in WezTerm.
Configure WezTerm to bind Ctrl+V to PasteFrom 'Clipboard' so the terminal performs text paste before Codex sees the key event.
Add a right-click PasteFrom 'Clipboard' mouse binding in WezTerm, including the mouse_reporting = true case for TUI applications.
This seems like another data point supporting the proposal here: when Ctrl+V reaches Codex as a key event, Codex should either try text clipboard content first in local desktop sessions, or show a text-paste hint instead of immediately taking the image-paste path.
Please fix this. I'm unwilling to type into the console like a peasant, and this is also blocking voice to text with programs like blabby.
i should be able to use ctrl + v for pasting both images, text and the results of vtt.
I can reproduce the plain-text Ctrl+V → image-paste error on native Ubuntu with the standalone Codex CLI 0.157.0.
Environment:
OS: Ubuntu 26.04.1 LTS
Terminal: GNOME Terminal
TERM: xterm-256color
COLORTERM: truecolor
Affected: standalone Codex CLI 0.157.0 ($HOME/.local/bin/codex is first on PATH)
Comparison on the same PC: older npm-installed Codex CLI 0.142.3 (/usr/local/bin/codex) and the Codex Desktop App
Steps:
Copy plain text to the OS clipboard.
Open the standalone Codex CLI TUI.
Press Ctrl+V in the input field.
Expected: The plain text appears in the input field.
Actual: Codex attempts an image paste and reports an error equivalent to Failed to paste image: no image on clipboard.
Ctrl+Shift+V pastes the text successfully in the affected CLI. The older npm-installed CLI and Desktop App also behave as expected on the same PC. This comparison narrows the area to investigate, but does not establish the cause or whether the difference is specific to the standalone distribution.
I also reported this to OpenAI Support. Support could not confirm from available documentation that this is a recognized 0.157.0 bug, intended behavior, or associated with a confirmed fix date. They described a public GitHub issue as a way to share reproduction details.
I can provide additional session details if useful.
Another data point, native Windows this time (no WSL, no remote session): @openai/codex 0.157.0 from npm on Windows 11 Pro N (10.0.26200), TUI running in the legacy console host (conhost, which was the default terminal on this machine).
The clipboard holds plain text (checked with Get-Clipboard; formats present: UnicodeText, Text, OEMText).
Ctrl+V in the composer → Failed to paste image: no image on clipboard: The clipboard contents were not available in the requested format or the clipboard is empty.
TUI log: codex_tui::clipboard_paste paste_image_as_png: attempting clipboard image read, then codex_tui::chatwidget::interaction failed to paste image: no image on clipboard. No text-paste attempt follows.
conhost has no bracketed paste and hands Ctrl+V to the application as a key event, so on this terminal the key-event path is the only path there is, and it is image-only, exactly as described in this issue.
Right-click (QuickEdit) paste still works, because conhost types the characters itself.
Same binary inside Windows Terminal 1.24 (Ctrl+V bound to Terminal.PasteFromClipboard, delivered as a paste event): the text lands in the composer as expected. Verified.
On this machine Ctrl+V text paste in conhost worked with the previous npm release (updated to 0.157.0 on 2026-09-25).
Switching the default terminal to Windows Terminal is the workaround used here. A clipboard-text fallback in the key-event path, as proposed above, would make the legacy console usable again.
Please implement this, as well as a keyboard shortcut for pasting over SSH. I am blind and use a screen reader. I have typically been able to paste by asking my screen reader to send a right click command but recently, that functionality has regressed, see #47469
Now that right click is also broken, this is becoming a pretty significant a11y issue and might make me switch to another agent.
Please implement this, as well as a keyboard shortcut for pasting over SSH. I am blind and use a screen reader. I have typically been able to paste by asking my screen reader to send a right click command but recently, that functionality has regressed, see #47469
Now that right click is also broken, this is becoming a pretty significant a11y issue and might make me switch to another agent.
Use /tui to switch to "scrollback" mode and the right-click works again
Activity
github-actions commentedon Apr 8, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
dolzenko commentedon Apr 8, 2026
A little more context - #4818 (comment) I originally needed this for implementing cross-layout Ctrl-V paste with alacritty
#16223 is also very likely might be solved with this change.
dolzenko commentedon Apr 9, 2026
a64505379 the changeset codex gave me
sunjiajunsunjiajun commentedon Jul 16, 2026
This root-cause explanation matches another real-world reproduction path.
In a Windows remote-control setup using UU remote connection + WezTerm, plain text paste can fail with the image-paste error:
The user is not pasting an image. The likely sequence is:
Ctrl+Vas raw key events.Ctrl+V.The same machine had a working text-paste path in traditional
cmd.exevia mouse right-click paste, which suggests the text clipboard can be fine and the failure depends on whether the terminal consumes the paste shortcut or passesCtrl+Vthrough to Codex.Workarounds that avoid the issue:
Ctrl+Shift+VorShift+Insertin WezTerm.Ctrl+VtoPasteFrom 'Clipboard'so the terminal performs text paste before Codex sees the key event.PasteFrom 'Clipboard'mouse binding in WezTerm, including themouse_reporting = truecase for TUI applications.This seems like another data point supporting the proposal here: when
Ctrl+Vreaches Codex as a key event, Codex should either try text clipboard content first in local desktop sessions, or show a text-paste hint instead of immediately taking the image-paste path.ofirgeller commentedon Aug 8, 2026
Please fix this. I'm unwilling to type into the console like a peasant, and this is also blocking voice to text with programs like blabby.
i should be able to use ctrl + v for pasting both images, text and the results of vtt.
LANCER1254 commentedon Sep 25, 2026
I can reproduce the plain-text Ctrl+V → image-paste error on native Ubuntu with the standalone Codex CLI 0.157.0.
Environment:
$HOME/.local/bin/codexis first on PATH)/usr/local/bin/codex) and the Codex Desktop AppSteps:
Expected: The plain text appears in the input field.
Actual: Codex attempts an image paste and reports an error equivalent to
Failed to paste image: no image on clipboard.Ctrl+Shift+V pastes the text successfully in the affected CLI. The older npm-installed CLI and Desktop App also behave as expected on the same PC. This comparison narrows the area to investigate, but does not establish the cause or whether the difference is specific to the standalone distribution.
I also reported this to OpenAI Support. Support could not confirm from available documentation that this is a recognized 0.157.0 bug, intended behavior, or associated with a confirmed fix date. They described a public GitHub issue as a way to share reproduction details.
I can provide additional session details if useful.
foxsalaf commentedon Sep 26, 2026
Another data point, native Windows this time (no WSL, no remote session):
@openai/codex0.157.0 from npm on Windows 11 Pro N (10.0.26200), TUI running in the legacy console host (conhost, which was the default terminal on this machine).Get-Clipboard; formats present:UnicodeText,Text,OEMText).Failed to paste image: no image on clipboard: The clipboard contents were not available in the requested format or the clipboard is empty.codex_tui::clipboard_paste paste_image_as_png: attempting clipboard image read, thencodex_tui::chatwidget::interaction failed to paste image: no image on clipboard. No text-paste attempt follows.Terminal.PasteFromClipboard, delivered as a paste event): the text lands in the composer as expected. Verified.On this machine Ctrl+V text paste in conhost worked with the previous npm release (updated to 0.157.0 on 2026-09-25).
Switching the default terminal to Windows Terminal is the workaround used here. A clipboard-text fallback in the key-event path, as proposed above, would make the legacy console usable again.
CallMeAl1973 commentedon Sep 26, 2026
Please implement this, as well as a keyboard shortcut for pasting over SSH. I am blind and use a screen reader. I have typically been able to paste by asking my screen reader to send a right click command but recently, that functionality has regressed, see #47469
Now that right click is also broken, this is becoming a pretty significant a11y issue and might make me switch to another agent.
gaspode commentedon Oct 6, 2026
Use /tui to switch to "scrollback" mode and the right-click works again
feat(tui): paste copied files and text with ctrl+v
etraut-openai commentedon Nov 21, 2026
Thanks for the bug report. This will be addressed in an upcoming release.