Cannot paste text into Codex CLI in VS Code integrated terminal on macOS

Open 💬 8 comments Opened Mar 6, 2026 by yugook
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.111.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.3-codex

What platform is your computer?

Darwin 25.3.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

VS Code integrated terminal (VS Code 1.110.0)

What issue are you seeing?

I cannot paste text into the Codex CLI prompt when running Codex in the VS Code integrated terminal on macOS.

The pasted text does not appear in the prompt as expected.

No error message is shown.

What steps can reproduce the bug?

  1. Open VS Code on macOS
  2. Open the integrated terminal
  3. Run codex
  4. Copy plain text
  5. Try to paste it into the Codex prompt

What is the expected behavior?

The pasted text should appear normally in the Codex prompt.

Additional information

Also reproduced on Codex CLI v0.110.0.

Environment:

  • MacBook
  • VS Code integrated terminal
  • model shown in the session header: gpt-5.3-codex high

View original on GitHub ↗

8 Comments

github-actions[bot] contributor · 4 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #13729
  • #13580
  • #13040

Powered by Codex Action

yugook · 4 months ago

I investigated this issue and prepared a fix in my fork, but I cannot open a PR to openai/codex because PR creation is currently restricted to collaborators.

Root cause

On macOS + VS Code integrated terminal, Cmd+V may be delivered as a SUPER+V key event without a normal Paste event, so pasted text never reaches the Codex composer.

Fix

  • Detect SUPER+V (Cmd+V) in TUI key handling.
  • Limit fallback to macOS + VS Code terminal only.
  • On that key event, read clipboard text directly and pass it to existing handle_paste(...).

Scope / non-goals

  • This change is only for text paste fallback (Cmd+V) on macOS VS Code terminal.
  • It does not change copy behavior (Cmd+C) in this patch.

Validation

  • Added key-detection tests for SUPER+V.
  • cargo test -p codex-tui passed locally.

Patch

If maintainers want to take it, you can cherry-pick:

git fetch https://github.com/yugook/codex.git codex/fix-vscode-macos-super-v-paste-fallback
git cherry-pick 5be7f8a59b8db74e64bc6174ff18ed642acad6bf
hxhue · 4 months ago

I have a similar issue, where Ctrl+Shift+C (copy text) is recognized as Ctrl+C (terminate), and Ctrl+Shift+V (paste text) is recognized as Ctrl+V (paste image).

Version: codex-cli 0.111.0
Terminal: VS Code integrated terminal
OS: Linux (WSL)

hxhue · 4 months ago
I have a similar issue, where Ctrl+Shift+C (copy text) is recognized as Ctrl+C (terminate), and Ctrl+Shift+V (paste text) is recognized as Ctrl+V (paste image). Version: codex-cli 0.111.0 Terminal: VS Code integrated terminal OS: Linux (WSL)

Workaround: launch codex inside tmux.

yugook · 4 months ago

I found that right-click copy/paste works for me in the VS Code integrated terminal, but Cmd+V still does not paste into the Codex composer.

Possibly related: microsoft/vscode#299515, though the symptom is not identical.

josiahH-cf · 4 months ago

Changed a setting in vscode to and had to disable preferences

"editor.pasteAs.preferences": [
"text.plain"

]

just a temp workaround until it's resolved

Norlandz · 2 months ago

Im using Codex extension openai.chatgpt in VSCode.
Im not using codex CLI.
Windows 11.

(am i in the wrong post?)

---

Workaround: I changed to use this in keybindings.json

  {
    "key": "ctrl+v",
    "command": "editor.action.clipboardPasteAction",
    "when": "activeAuxiliary == 'workbench.view.extension.codexSecondaryViewContainer' && !(filesExplorerFocus && foldersViewVisible && !explorerResourceReadonly && !inputFocus)"
  },

---

misc thinking process info:

  • right click the input text box shows the paste hotkey is shift+insert
  • search what the ctrl+v is doing in hotkey setting.
  • try to assign ctrl+v to paste. then it works.
  • but the file explorer paste is now conflicting.
  • also the default global ctrl+v is conflicting. I removed it.
  • try to use Developer: Inspect Context Keys to find the when expression.
  • try to use when expression from the explorer ctrl+v.
  • etc
yugook · 2 months ago

Hi @Norlandz — thanks for sharing the workaround. I think this may be a separate issue, since this thread is about Codex CLI on macOS + VS Code integrated terminal, while your case seems to involve the VS Code extension on Windows. Opening a separate issue might make it easier for maintainers to triage, and your workaround would be easier for others to find there too.