mirror of
https://github.com/openai/codex.git
synced 2026-11-25 23:30:49 +00:00
Preserve multiline pastes without bracketed paste markers (#63785)
## Why When a terminal sends pasted text as individual keystrokes, the TUI can mistake a pasted newline for a submit key. This can happen after a short Unicode prefix or after a redraw has already displayed a pasted line. ## What changed Keep the paste detection window open after buffered text becomes visible. Treat plain Enter within that window as a pasted newline and buffer any following indentation with it. A single IME character still allows Enter to submit in the regular composer. Apply the same paste timing to startup drafts so Enter can confirm the draft once the paste window expires. Keep newline-and-tab-only pastes literal inside blockquotes. ## Testing Cover multiline pastes with Unicode prefixes, tabs after pasted newlines, and Enter handling before and after the paste window expires. GitOrigin-RevId: e8f63dfead0cc97d44001000e961a6f6d05d4900
This commit is contained in:
@@ -116,7 +116,9 @@ async fn picker_side_worktree_fork_and_cd_run_on_the_production_stack() -> Resul
|
||||
// A trailing bare Escape must not consume the first character of the fresh edit.
|
||||
terminal.write_input(b"\x1b[27u\x1b[27u\r\x1b[27u\x1b[27u\r\x1b")?;
|
||||
terminal.wait_for_screen("Conversation reverted to this point")?;
|
||||
terminal.write_input(b" Revised.")?;
|
||||
// Leave the leading space unmarked to exercise Escape, then explicitly
|
||||
// end the paste so the next Enter is an unambiguous submit.
|
||||
terminal.write_input(b" \x1b[200~Revised.\x1b[201~")?;
|
||||
terminal.wait_for_screen("Reply with the marker requested by this test. Revised.")?;
|
||||
let _edited_reply = responses::mount_sse_once_match(
|
||||
&server,
|
||||
|
||||
Reference in New Issue
Block a user