-
Notifications
You must be signed in to change notification settings - Fork 2
better function key support for rxvt-unicode #1
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
base: legacy
Are you sure you want to change the base?
Conversation
|
Please also consider checking gdamore/tcell, since this might be upstream relevant and then should be fixed there too. |
|
@gdamore Would you be interested in this PR? It has several merge conflicts with your main branch, so I'd rather ask before I start fixing them. |
|
Maybe he prefers to receive it as issue or PR directly within the upstream repository. I've no problem with such stuff, but we've to keep in mind that we like to get closer to the upstream version instead of moving away. 😉 Anyway please leave it open till we find some time to consider it. |
|
In general I don't necessarily see issues you mention me on, as I don't look for mentions. I do monitor against my own repos of course, but this was filed against a downstream fork. Now I've made a bunch of changes recently to tcell that probably works well with rxvt. Having said that, my local urxvt (which I'm not a frequent user of) uses Shift and Control with function keys to access higher numbered function keys, rather than modified function keys. I'll also note that urxvt seems to be lagging in that it does not support any of the nicer and newer key protocols -- there are three possible choices it could use, and we'd work better if it supported any of them. In decreasing order of priority:
I don't love the idea of hard coding escape sequences that only work with hand-tuned Xresources. In fact, if you're going to do that, with new tcell, you could instead make those resources just send escape sequences that match one of the ones we already support. (Tcell v2.10 and higher will now decode all the key sequences, so if it matches any of them it will match all of them.) At that point you can just make these send the kitty/xterm sequences instead. For example: Shift Control F1 (F1 uses CSI final byte A): That is, it is CSI 1 ; 6 A The value for 6 can be calculated as a bit mask + 1 ... The following modifiers are known: Shift - 1 (There are others as well). The base key is the final letter in the sequence. Here are the known values: So you could simply change your Xresources to match the existing protocol, instead of inventing something new. |
|
Upstream tcell won't recognize your newly invented escape sequences, given that a reasonable solution (outlined above) already exists. |
This PR (copied here from zyedidia#30) adds function key support for rxvt-unicode (urxvt) in a way analogous to xterm. Specifically, it can report the following keys:
F1toF10, also with any combination ofShift,CtrlandAlt. (Altplus function key is often caught by the window manager, however.) Currently combinations of function keys withShiftare reported asF11toF20and the rest as raw key events.F11andF12(and up toF20, if you have them) if used together withShiftand possiblyCtrland/orAlt.Insert,Delete,Home,End,PageUp,PageDown, also with any combination ofShift,CtrlandAlt(Note that by defaultShiftplusInsert,PageUpandPageDownare caught by urxvt for its own purposes.) Currently, the modifier combinationsShift+CtrlandAlt-Shift-Ctrlare reported as raw key events.Up,Down,Right,Left, also withShiftorCtrl, possibly plusAlt. CurrentlyCtrl-Upis reported as raw key event (same plusAlt) andCtrl-Shift-UpasUp(same plusAlt) .The following work with tweaking the user's
.Xresources:F11(plusCtrl) fromShift-F1(plusCtrl), same forF12(up toF20). I've added newly invented key codes for these cases. To use them, one needs to add something like the following to.Xresources:F11works with any combination of modifiers. ForF12one needs to replace[23by[24.Shift-UpandCtrl-Shift-Up, and similarly for the other cursor keys. I've instead implemented the "application mode" codes forCtrl-Shift, see the urxvt documentation. To use them, one needs something like the following in.Xresources:The PR also seems to work with rxvt-like terminals (tested with Eterm). I don't kow about the original rxvt; I didn't find it in a web search.