From 5fcf923c19ea0ef62164602528ec483850738d76 Mon Sep 17 00:00:00 2001 From: Rohan Godha Date: Sun, 2 Nov 2025 23:19:08 -0500 Subject: [PATCH] fix: pasting api key stray character (#4903) When signing in with an API key, pasting (with command+v on mac) adds a stray `v` character to the end of the api key. demo video (where I'm pasting in `sk-something-super-secret`) https://github.com/user-attachments/assets/b2b34b5f-c7e4-4760-9657-c35686dd8bb8 --- codex-rs/tui/src/onboarding/auth.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/codex-rs/tui/src/onboarding/auth.rs b/codex-rs/tui/src/onboarding/auth.rs index 56527ac8..06e1c629 100644 --- a/codex-rs/tui/src/onboarding/auth.rs +++ b/codex-rs/tui/src/onboarding/auth.rs @@ -10,6 +10,7 @@ use codex_login::ShutdownHandle; use codex_login::run_login_server; use crossterm::event::KeyCode; use crossterm::event::KeyEvent; +use crossterm::event::KeyEventKind; use crossterm::event::KeyModifiers; use ratatui::buffer::Buffer; use ratatui::layout::Constraint; @@ -428,7 +429,9 @@ impl AuthModeWidget { should_request_frame = true; } KeyCode::Char(c) - if !key_event.modifiers.contains(KeyModifiers::CONTROL) + if key_event.kind == KeyEventKind::Press + && !key_event.modifiers.contains(KeyModifiers::SUPER) + && !key_event.modifiers.contains(KeyModifiers::CONTROL) && !key_event.modifiers.contains(KeyModifiers::ALT) => { if state.prepopulated_from_env {