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

Allow custom xterm keybindings to be turned off by consumers (and provide APIs for them) #264

Closed
Tyriar opened this issue Sep 6, 2016 · 11 comments
Labels
type/enhancement Features or improvements to existing features

Comments

@Tyriar
Copy link
Member

Tyriar commented Sep 6, 2016

As per #239 (comment) I think things like alt+arrow to jump words should be able to be turned off (or be off by default).

It does make sense for this stuff to be integrated into xterm.js so it works as most people would expect out of the box. However, in vscode for example, I would prefer if alt+arrow for example was routed to vscode's keybinding system so that users can define their own keybindings for this. In other words, I would like to turn this off and have vscode call into a public API to send the "Jump over word left/right" key sequence.

@Tyriar Tyriar added the type/enhancement Features or improvements to existing features label Sep 6, 2016
@parisk
Copy link
Contributor

parisk commented Sep 8, 2016

I am 👍 on this. I think one good thing we could do is create an API which is compatible with the inputrc format: http://www.securitronlinux.com/mint_linux/using-the-inputrc-file-to-control-keybindings-in-xterm/.

This could provide great experience with the user's customization's available out-of-the-box, when xterm.js is wrapped in native applications like vscode.

@Tyriar
Copy link
Member Author

Tyriar commented Sep 8, 2016

Yeah I need to check out what's in my .inputrc and what if anything is done via gnome-terminal-specific settings.

@ayapi
Copy link
Contributor

ayapi commented Sep 26, 2016

hmmm...? Xterm reads .inputrc? from my understanding, .inputrc is for Readline, not related to Xterm.
i thought .Xresources ( XTerm.VT100.translations: #override ) is suitable for this issue.
like this -> http://unix.stackexchange.com/questions/138501/keybinding-in-xterm-to-shift-one-line-up-using-shiftup

@parisk
Copy link
Contributor

parisk commented Sep 29, 2016

It was just a proposal to understand the syntax. X resources seems more suitable though.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 1, 2018

I'm closing this off to keep out issue count lower as it hasn't gained any traction, is stale or is not worth tracking.

@Tyriar Tyriar closed this as completed Jun 1, 2018
@Tyriar Tyriar added the stale label Jun 1, 2018
@Alex-duzhichao
Copy link

@Tyriar Hi, should this problem be fixed?
I'm using vim with mapped Alt+Arrow keys to jump to different panes. It does work with other terminals (powershell, alacrity...), but doesn't work with xterm.js

The command showkey -a shows xterm.js sends different codes with other terminals':

alacrity xterm.js
alt - up ^[[1;3A ^[[1;5A
alt - down ^[[1;3B ^[[1;5B
alt - left ^[[1;3D ^[[1;5D
alt - right ^[[1;3C ^[[1;5C

@jerch
Copy link
Member

jerch commented Apr 12, 2023

I dont quite get the idea behind those "// HACK: Make Alt + left-arrow behave like Ctrl + left-arrow:" changes in Keyboard.ts. By what were these hacks justified? Why would anyone want Alt+Arrow to behave exactly like Ctrl+Arrow?

@Tyriar
Copy link
Member Author

Tyriar commented May 24, 2023

@jerch it might have been me making things act as I would have expected when I was a noob. If so these should probably be in vscode's keybindings instead

@Tyriar
Copy link
Member Author

Tyriar commented May 24, 2023

#4538

@jerch
Copy link
Member

jerch commented May 24, 2023

@Tyriar Ah no worries, was just trying to get the idea behind that change, and I was not able to find the reason in the old issues/commits. Because if there is a good reason, we prolly cannot simply change it to something else.

#4538

👍 To make it somehow configurable is prolly the best idea. Hopefully thats not too tricky, I always get the impression, that the key handling code is full of pitfalls and fixing one thing will break 2 others 😅

@Tyriar
Copy link
Member Author

Tyriar commented May 24, 2023

The custom keybindings request in xterm.js was eventually closed as embedders can set it up to do whatever they want. My philosophy since then has been do baseline behavior in xterm.js and anything non-standard in embedders where you can probably configure as a user.

Some built-in examples in vscode that try make the terminal act more like the editor:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Features or improvements to existing features
Projects
None yet
Development

No branches or pull requests

5 participants