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

investigate XTMODKEYS in the absence of kitty keyboard protocol #2135

Closed
dankamongmen opened this issue Sep 2, 2021 · 7 comments
Closed
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request input readin' dem bytes
Milestone

Comments

@dankamongmen
Copy link
Owner

See #2131. Most terminals don't support the Kitty protocol, but many might support XTMODKEYS for basic improvements. XTerm certainly does. Look into using it.

@dankamongmen dankamongmen added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 2, 2021
@dankamongmen dankamongmen added this to the 3.0.0 milestone Sep 2, 2021
@dankamongmen dankamongmen self-assigned this Sep 2, 2021
@kovidgoyal
Copy link

Your biggest problem will be handling shifted keys. XTMODKEYS is completely unspecified in its behavior and this will mean that pressing say alt+shift+x may or may not give you the upper cased or lowercased variants.

@dankamongmen dankamongmen added the input readin' dem bytes label Sep 23, 2021
@dankamongmen dankamongmen removed this from the 3.0.0 milestone Oct 3, 2021
@dankamongmen
Copy link
Owner Author

so it looks like we want something like

echo -e '\e[>4;2m\e[>1;2m\e[>0;2m\e[>2;2m

issued at the beginning.

hey @kovidgoyal , the doc says In the interests of interoperation, the XTerm specific sequences CSI > 4; 1 m and CSI > 4; 0 m are treated as CSI > 1 u and CSI < 1 u. is that supposed to be CSI=1u and CSI=0u? it seems like the line is absent in the current git.

@kovidgoyal
Copy link

kovidgoyal commented Oct 5, 2021 via email

@dankamongmen
Copy link
Owner Author

got it, thanks for the heads up. my plan right now is to emit several XTMODKEYS codes followed by a kitty-specific code. so long as other terminals are ignoring the kitty specific code, this strategy ought be fine for kitty, right?

@kovidgoyal
Copy link

kovidgoyal commented Oct 5, 2021 via email

dankamongmen added a commit that referenced this issue Oct 7, 2021
Add prep_xtmodkeys() to handle modified function keys.
Unify several paths into load_ncinput(), eliminating
 several paths that missed statistics and drain checks.
Process mouse clicks outside of critical section.
Handle XTMODKEY sequences with parameter 5.
Interpret 0x8 as NCKEY_BACKSPACE on all paths.
Send XTMODKEYS of 2;1 and 4;1 #2135.
@dankamongmen
Copy link
Owner Author

Alright, I'm now sending XTMODKEYS of 2;1 and 4;1, and processing most of the new keycodes. We now correctly and precisely identify a good number of modified sequences on XTerm that we didn't before, huzzah. This is in the dankamongmen/xtmodkeys branch.

@dankamongmen dankamongmen added this to the 3.0.0 milestone Oct 7, 2021
dankamongmen added a commit that referenced this issue Oct 7, 2021
Add prep_xtmodkeys() to handle modified function keys.
Unify several paths into load_ncinput(), eliminating
 several paths that missed statistics and drain checks.
Process mouse clicks outside of critical section.
Handle XTMODKEY sequences with parameter 5.
Interpret 0x8 as NCKEY_BACKSPACE on all paths.
Send XTMODKEYS of 2;1 and 4;1 #2135.
@dankamongmen
Copy link
Owner Author

actually, @kovidgoyal , the expression i outlined above is no good; i need to do the XTMODKEYS after pushing the current keyboard state, because apparently XTMODKEYS gets pushed/popped with your \e[<>u. so i'm probably going to do:

  • push kbd
  • xtmodkeys 2;1
  • xtmodkeys 4;1
  • =3u

dankamongmen added a commit that referenced this issue Oct 7, 2021
Add prep_xtmodkeys() to handle modified function keys.
Unify several paths into load_ncinput(), eliminating
 several paths that missed statistics and drain checks.
Process mouse clicks outside of critical section.
Handle XTMODKEY sequences with parameter 5.
Interpret 0x8 as NCKEY_BACKSPACE on all paths.
Send XTMODKEYS of 2;1 and 4;1 #2135.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request input readin' dem bytes
Projects
None yet
Development

No branches or pull requests

2 participants