mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
Consume complete SS3 startup key sequences
This commit is contained in:
@@ -426,6 +426,15 @@ mod imp {
|
||||
}
|
||||
index = end;
|
||||
}
|
||||
Some(b'O') => {
|
||||
let Some(final_byte) = buffer.get(index + 2) else {
|
||||
break;
|
||||
};
|
||||
if !(0x40..=0x7e).contains(final_byte) {
|
||||
break;
|
||||
}
|
||||
index += 3;
|
||||
}
|
||||
Some(_) => index += 2,
|
||||
None => break,
|
||||
}
|
||||
@@ -626,6 +635,11 @@ mod imp {
|
||||
b"draft text"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn extracts_plain_input_around_ss3_key_sequences() {
|
||||
assert_eq!(extract_plain_input(b"draft\x1BOP text"), b"draft text");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user