bug: pasting in API key includes stray 'v' character on mac

Resolved 💬 4 comments Opened Oct 31, 2025 by rgodha24 Closed Nov 3, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.53.0

What subscription do you have?

n/a

Which model were you using?

n/a

What platform is your computer?

Darwin 24.6.0 arm64 arm with ghostty

What issue are you seeing?

Command+V to paste in the API key into the Provide your own API key prompt sometimes includes a stray v character at the end of the key.

<img width="454" height="276" alt="Image" src="https://github.com/user-attachments/assets/ba05acd9-5f49-4b12-9cc8-aaaf04fd60da" />

This also happens when sshed into a Linux machine from my mac+ghostty setup.

What steps can reproduce the bug?

  1. run codex
  2. run /logout
  3. copy an api key like sk-something-super-secret
  4. run codex, and choose sign in with api key
  5. attempt to paste in the API key, and see the stray v character appear.

https://github.com/user-attachments/assets/ee1ea44a-e1bd-419e-8d61-33735aca0ba3

This issue does NOT exist on Linux directly, where my paste keybinding is ctrl+shift+v.

What is the expected behavior?

pasting in API keys works as expected.

Additional information

Fixed by #4903

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 10 months ago

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

  • #5843
  • #5684
  • #5808

Powered by Codex Action

etraut-openai contributor · 9 months ago

I haven't been able to repro the problem. I've installed the latest version of ghostty on an Apple Silicon Mac. When I log in with an API Key and paste text, I don't see an extra "v". Is there anything else that needs to be done to repro?

You said above that it _sometimes_ inserts an extra "v". I presume that means it's intermittent. Do you suspect that it's timing related?

rgodha24 contributor · 9 months ago

I think it's related to the order you release cmd and v. it happens intermittently if you press the v button a little bit after you press the cmd button, and release the cmd button first. here's a video with the macos built in keyboard showing:

https://github.com/user-attachments/assets/e4425b96-f39a-4b2c-95e5-3b334f79460f

etraut-openai contributor · 9 months ago

Fix is merged. Thanks for the contribution!