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

multiple variations of escape sequences #24

Open
suresttexas00 opened this issue Mar 26, 2017 · 0 comments
Open

multiple variations of escape sequences #24

suresttexas00 opened this issue Mar 26, 2017 · 0 comments

Comments

@suresttexas00
Copy link

suresttexas00 commented Mar 26, 2017

We have another problem. There are many keys that have different escape sequences, depending not only on distro (of linux), but even whether or not one is in a TTY session or a term window on the desktop:

for instance these:

# these are correct in a gnome term window or a PyCharm window:
F1 = '\x1b\x4f\x50'
F2 = '\x1b\x4f\x51'
F3 = '\x1b\x4f\x52'
F4 = '\x1b\x4f\x53'
F5 = '\x1b\x5b\x31\x35\x7e'

# in a TTY session these are the correct values!
F1_1 = '\x1b\x5b\x5b\x41'
F2_1 = '\x1b\x5b\x5b\x42'
F3_1 = '\x1b\x5b\x5b\x43'
F4_1 = '\x1b\x5b\x5b\x44'
F5_1 = '\x1b\x5b\x5b\x45'

This makes our situation even worse. I can only imagine the problems that may exist when we add windows in the equation. This may explain issues like #14, since this issue also affects page keys and home/end as well...

We run into more problems with F11 and F12 because of these mappings:

F11_1 = '\x1b\x5b\x32\x33\x7e'  # tty
F11 =     '\x1b\x5b\x32\x33\x7e\x1b'  # gnome
F12_1 = '\x1b\x5b\x32\x34\x7e'  # tty
F12 =     '\x1b\x5b\x32\x34\x7e\x08'  #gnome

As you see, the \x1b\x5b\x32\x34\x7e is also (or needs to be) in ESCAPE_SEQUENCES. So we have the same problem as the lone ESC key... another key must be pressed to return the sequence (if we are in a TTY).

More details of how keys are variously interpreted depending on what 'layer' of the OS one is dealing with (and a few other informational tidbits) were found at this discussion:

https://www.zsh.org/mla/users/2014/msg00273.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant