Skip to content

Rewriting alt-ARROW STDIN to hard-coded 1;5? #5239

Answered by Tyriar
imsnif asked this question in Q&A
Discussion options

You must be logged in to vote

It's explained right above that:

result.key = C0.ESC + '[1;' + (modifiers + 1) + 'A';
// HACK: Make Alt + up-arrow behave like Ctrl + up-arrow
// http://unix.stackexchange.com/a/108106
// macOS uses different escape sequences than linux
if (!isMac && result.key === C0.ESC + '[1;3A') {
result.key = C0.ESC + '[1;5A';
}

This is one of the non-standard things xterm.js does that's a little risky to change at this point. If you want the standard behavior attachCustomKeyEventHandler is indeed the right thing to do

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@imsnif
Comment options

@Tyriar
Comment options

@jerch
Comment options

@imsnif
Comment options

Answer selected by Tyriar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
type/question A question on how to use the library
3 participants
Converted from issue

This discussion was converted from issue #5238 on December 10, 2024 13:33.