1
1
mirror of https://github.com/walles/moar.git synced 2024-11-22 03:14:56 +03:00

keys.go: Allow alternative Home/End key encoding

My setup is Tmux running in Alacritty on Debian Linux running on Chrome OS.
Before this change, Home and End keys did not work for me inside Tmux.
(Outside tmux, I don't think there was a problem).

I got the required sequences by running `cat` and pressing Home/End.

This looks similar to (or possibly the opposite of)
daafbcdac4.
The reference in that commit mentions these sequences for Home and End, these
kinds of sequences were already used for Delete, PgUp, and PgDown. 

For reference, the missing `\x1b[2~`  sequence would correspond to the Insert
key.
This commit is contained in:
Ilya Grigoriev 2023-09-29 22:56:33 -07:00
parent faafc49471
commit 7b8d7eafe3

View File

@ -64,6 +64,8 @@ var escapeSequenceToKeyCode = map[string]KeyCode{
"\x1b[H": KeyHome,
"\x1b[F": KeyEnd,
"\x1b[1~": KeyHome,
"\x1b[4~": KeyEnd,
"\x1b[5~": KeyPgUp,
"\x1b[6~": KeyPgDown,
}