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
This commit is contained in:
@@ -10,6 +10,7 @@ use codex_login::ShutdownHandle;
|
|||||||
use codex_login::run_login_server;
|
use codex_login::run_login_server;
|
||||||
use crossterm::event::KeyCode;
|
use crossterm::event::KeyCode;
|
||||||
use crossterm::event::KeyEvent;
|
use crossterm::event::KeyEvent;
|
||||||
|
use crossterm::event::KeyEventKind;
|
||||||
use crossterm::event::KeyModifiers;
|
use crossterm::event::KeyModifiers;
|
||||||
use ratatui::buffer::Buffer;
|
use ratatui::buffer::Buffer;
|
||||||
use ratatui::layout::Constraint;
|
use ratatui::layout::Constraint;
|
||||||
@@ -428,7 +429,9 @@ impl AuthModeWidget {
|
|||||||
should_request_frame = true;
|
should_request_frame = true;
|
||||||
}
|
}
|
||||||
KeyCode::Char(c)
|
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) =>
|
&& !key_event.modifiers.contains(KeyModifiers::ALT) =>
|
||||||
{
|
{
|
||||||
if state.prepopulated_from_env {
|
if state.prepopulated_from_env {
|
||||||
|
|||||||
Reference in New Issue
Block a user