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

ctrl-6 not passed to vim/terminal #240

Closed
ashb opened this issue Jan 16, 2020 · 6 comments
Closed

ctrl-6 not passed to vim/terminal #240

ashb opened this issue Jan 16, 2020 · 6 comments

Comments

@ashb
Copy link

@ashb ashb commented Jan 16, 2020

Ctrl+6 (or actually any Ctrl+number key) are not passed through to vim, or a normal terminal.

@ashb

This comment has been minimized.

Copy link
Author

@ashb ashb commented Jan 16, 2020

Guessing the problem is here:

if (ev.key >= '@' && ev.key <= '_') {
key = String.fromCodePoint(ev.key.codePointAt(0)-'@'.codePointAt(0));
} else if (ev.key >= 'a' && ev.key <= 'z') {
key = String.fromCodePoint(ev.key.codePointAt(0)-'a'.codePointAt(0)+1);
} else if (ev.key === ' ') {
// Ctrl space
key = '\x00';
}

It's only handling Ctrl A-Z, not not other keys on the keyboard. Ctrl-6 sends \x1e in other terminals (INFORMATION SEPARATOR TWO)

@ashb

This comment has been minimized.

Copy link
Author

@ashb ashb commented Jan 16, 2020

The behaviour of other terminals seems to be to pass Ctrl+anything as anything if it's not recognized, and these mappings:

ctrl+2: nul
ctrl+3-7: \x1b-\x1e
ctrl-8: \xf7

@sedwards2009

This comment has been minimized.

Copy link
Owner

@sedwards2009 sedwards2009 commented Jan 17, 2020

Do you know which other terminals are sending keys for Ctrl+? I had a quick look around here and it looks like the behaviour for these keys it very inconsistent between terminals.

@ashb

This comment has been minimized.

Copy link
Author

@ashb ashb commented Jan 28, 2020

For Ctrl+6 it's been sent for every terminal I can remember using: xfce-term, Terminal.app and iTerm2. (Ctrl+6 is the default vim key binding for switching between buffers.)

@ashb

This comment has been minimized.

Copy link
Author

@ashb ashb commented Jan 29, 2020

Oh and the linux console/text mode does the same.

sedwards2009 added a commit that referenced this issue Feb 2, 2020
@sedwards2009

This comment has been minimized.

Copy link
Owner

@sedwards2009 sedwards2009 commented Feb 9, 2020

Fixed in 0.49.1.

@sedwards2009 sedwards2009 added the fixed label Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.