Proposal: Use the patched crossterm and completely remove the paste logic that depends on burst.
codex's current paste detection logic on Windows is forced to rely on detecting burst windows to achieve paste functionality due to crossterm's lack of support for Console Virtual Terminal Sequences on the Windows platform.
However, existing solutions are not only complex and prone to bugs, but also result in a poor user experience. For example, the paste on Windows still sometimes leads to multi-line submissions due to some corner input, or some short text may be out of order, and there can be noticeable delays in scenarios requiring rapid input, such as IME scenarios.
I modified crossterm to support VT input on Windows and made some modifications to ensure compatibility with codex. Then, I completely removed the burst-related code from codex.
My testing shows that the patched codex resolves a class of input issues on Windows.
For example, pasting is reliably possible in all major terminals (Windows Terminal, VS Code Integrated Terminal, JetBrains Integrated Terminal). In VS Code and JetBrains' built-in terminals, Shift + Enter can be used for insert newline, while Windows Terminal supports Ctrl + Enter. After upgrading to the latest Windows Terminal Preview, which includes built-in support for the Kitty keyboard protocol (windows-terminal-preview-1-25-release), Shift + Enter is also supported. Furthermore, there is no lag when quickly typing text.
My experimental repo links:
https://github.com/occurrent/codex/tree/crossterm-codex-compatible
https://github.com/occurrent/crossterm/tree/experimental/windows-input
Furthermore, there's a earlier pr in the official crossterm repo https://github.com/crossterm-rs/crossterm/pull/1030; waiting for it to be merged might also be a good idea.
I'm not sure if issues area is the right place to post this content. If it's not appropriate, please close this issue.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗