-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Make the terminal emulator escape codes configurable for F-keys, etc. #2005
Comments
My 2 cents:
The VTE terminal emulator widget, which I'm a developer of, has hardcoded escape sequences for the keys. VTE is used by at least a dozen terminal emulator applications, including GNOME Terminal, Xfce4 Terminal, Terminator, Tilix, Guake, Roxterm just to name a few. According to various polls, I have the impression that VTE's market share (in terms of number of users) among graphical terminal emulators under Linux is in the ballpark of 50%, which is pretty significant. I keep an eye on the issue trackers of most VTE-based emulators, plus several forums. Ever since we changed our sequences to xterm-compatible (around 5 years ago), or more precisely, I should say "compatible with whatever the terminfo definition matching our $TERM says", we no longer get complaints about wrong sequences and hardly ever get a request for making these user configurable. Whenever it's a request, it's in the form of being able to differentiate two things that currently produce the same sequence, e.g. Enter from Shift+Enter; and not along the lines of let's say Home should generate Let's be honest, having to configure technical details like which key generates what sequence should be a thing of the past, it's a sign of an absolutely user-unfriendly developer attitude (which we carry from the past). I'm not against this feature request, but maybe your particular use case should be studied first, examined whether perhaps you do something wrong (e.g. have the wrong TERM set somewhere), see whether it's a common request. Maybe Windows Terminal could ship a few hardcoded keymaps, e.g. one for xterm and friends, one for the Linux console. Allowing the user to configure the keys is probably complicated. E.g. in VTE, F1 generates That being said, if Windows Terminal developers find your idea a great one and implement it, I'm by no means trying to stop them. |
@egmontkob Many thanks for the comment, very useful. Let me describe my use case in more details. I use different terminal emulators connecting to the remote GNU/Linux shell. Each terminal emulator supplies a correct
I use it to bind emitted escape sequence to correct F-keys, etc., using
As I detach
That is why, I would prefer consistent (configurable) escape codes bindings in each terminal emulator I use. |
@egmontkob Funnily enough, I've been looking at this at the moment and I'm evaluating using xterm's modifyOtherKeys - and related settings modifyKeyboard, modifyFunctionKeys etc - for a model in Windows Terminal. As a developer on the VTE team, have you looked at this yourself? How widely is it understood/accepted/used? I prefer this approach of having a well-known scheme for emitting sequences for modifiers, and allow people to modify the bindings on the consuming applications instead of modifying the emitted sequences on the terminal itself. |
I have to admit I'm not familiar with the details of However, what definitely happens for me is that Now, having multiple variants of I'm afraid that there's no real solution here. The TERM variable was designed with the idea that the actual capabilities of a terminal cannot change runtime, which is no longer true with One possible solution could be if I'm not sure whether this is only a problem with the output, or also with the input (keys) that this issue is about. E.g. I'm not sure what stops Back to your request of redefining keys: There's one more indirection to this story, since |
@oising VTE doesn't support The current extension seems broken to me, designing a good one is extremely hard (as per my last comment in the Tilix thread), thus the gain:investment ratio looked pretty bad for me to work on this. I don't know how much other terminals or apps support these. |
@egmontkob Great references, thank you. Windows Terminal has a rather unique mandate in that it tries to transparently handle console applications that may consume and/or emit VT or call win32 console APIs. With this in mind, there's a need to be able to encode anything that can come through the console API (which is pretty much anything) and pass it over the pseudo tty as a VT sequence, and optionally translate it back into API responses. Rather than invent something completely new, if we use this scheme, we can also allow it to pass through raw to clients, if they request VT. |
@egmontkob I have not finished reviewing all the references you provided yet, but there is one more relevant suggestion which is important (to my opinion) and fairly trivial to implement. As Windows Terminal is not 100% compatible with the I have checked the UPD: They already have What do you think? |
I second the idea of giving a menu similar to what Putty presents, just implemented in |
Huh. Coming across this feature request again, and I think this is absolutely doable with the That shipped a few releases ago, so that should be in stable by now. |
Summary of the new feature/enhancement
@DHowett Make the terminal emulator escape codes, associated with functional keys, keypad, cursor keys, etc., configurable via
profile.json
. At the moment they are hardcoded withinterminal/src/terminal/input/terminalInput.cpp
. Such causes troubles while working with remote GNU/Linux shells from different terminal emulators, having the sameTERM
environment variable set.For the reference: most popular terminal emulators, available on the market, have such an ability.
Proposed technical implementation details (optional)
Just add the configuration keywords for the described keys into the
profile.json
and make the ability to override the hardcoded escape sequences.The text was updated successfully, but these errors were encountered: