Skip to content
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

Work around Linux keycodes by mapping ^_ to ^7 #5

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion zee/src/components/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,22 @@ impl Component for Buffer {
.command("undo", |this: &Self| {
this.properties.cursor.undo();
})
.with([Ctrl('_')])
.with([Ctrl('z')])
// On Linux terminal, keycodes for `^/`, `^_`, and `^7` are the same. The
// parsed key depends on the library that handles the input. In case of Zee,
// it uses Zi framework for terminal based applications, which uses
// crossterm library to get key events.
//
// For more details, see crossterm issues:
// - https://github.com/crossterm-rs/crossterm/issues/540
// - https://github.com/crossterm-rs/crossterm/issues/685
//
// To check if it reproduces on your machine, you can try
// ```shell
// showkey --ascii
// ```
.with([Ctrl('7')])
.with([Ctrl('_')])
.with([Ctrl('/')]);

// Redo
Expand Down
Loading