-
Notifications
You must be signed in to change notification settings - Fork 280
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
Add CSIu parser for unix #595
Conversation
0d34b04
to
236d94b
Compare
236d94b
to
7288f83
Compare
// Issue #371: \n = 0xA, which is also the keycode for Ctrl+J. The only reason we get | ||
// newlines as input is because the terminal converts \r into \n for us. When we | ||
// enter raw mode, we disable that, so \n no longer has any meaning - it's better to | ||
// use Ctrl+J. Waiting to handle it here means it gets picked up later | ||
'\n' if !crate::terminal::sys::is_raw_mode_enabled() => KeyCode::Enter.into(), |
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.
I do not fully understand if the raw-mode check is warranted:
CSIu decimal ASCII encoding should be rather unambigous
10 -> LF
13 -> CR
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.
This pr have the context: #373
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.
Since the new line and CTRL+J overlapped in byte code, we need to pick one of them. Since newline doesn't occur when raw mode is enabled we can exclude \n in that case.
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.
One remaining question..
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.
Late response. Anyhow, thanks! I would prefer to see some tests for this like the other codes. I can assume it work but I don't have the machine to test it myself. Anyhow can't do much harm better some support then non at all.
closes #595
This is used for
helix-editor
keymaps.