-
-
Notifications
You must be signed in to change notification settings - Fork 666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move from termion to termwiz for STDIN handling #1249
Conversation
@tlinford - I'm still working on the flakiness of the e2e tests that this introduced, but would be happy for your input as I'm doing so (time allowing, ofc). I had to change the |
Hey @imsnif, I left a comment above about the one thing that seems to be missing, which is the mouse event repeater that makes scrolling up/down while selecting work. Seems like termwiz is doing a lot of things right, the one thing that has me a bit concerned is the mouse events - but I think the solution you made with
This is encoding mouse events using the "Normal" (1000) encoding: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Normal-tracking-mode. Not sure why it breaks with termwiz, but might be worth investigating a little further, because if it doesn't work we should probably not try and enable it here either:
|
// MouseRelease) we need to keep sending this instruction to the app, | ||
// because the app itself doesn't have an event loop in the proper | ||
// place | ||
let mut poller = os_input.stdin_poller(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to readd this, or figure out a better way to do the same thing?
At the moment we've lost the scrolling while selecting behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Readded, thanks!
src/tests/e2e/cases.rs
Outdated
@@ -58,15 +58,16 @@ pub const BRACKETED_PASTE_START: [u8; 6] = [27, 91, 50, 48, 48, 126]; // \u{1b}[ | |||
pub const BRACKETED_PASTE_END: [u8; 6] = [27, 91, 50, 48, 49, 126]; // \u{1b}[201 | |||
pub const SLEEP: [u8; 0] = []; | |||
|
|||
// simplified, slighty adapted version of alacritty mouse reporting code | |||
pub fn normal_mouse_report(position: Position, button: u8) -> Vec<u8> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpicking, but should probably call this sgr_mouse_report now
This change lays down some groundwork for: