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

Send different key codes for Tab and Ctrl+I (READ: support modifyOtherKeys) #13792

Open
ghillb opened this issue Aug 20, 2022 · 6 comments
Open
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Area-VT Virtual Terminal sequence support Help Wanted We encourage anyone to jump in on these. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conhost For issues in the Console codebase
Milestone

Comments

@ghillb
Copy link

ghillb commented Aug 20, 2022

Description of the new feature/enhancement

When using ms-terminal, Tab and Ctrl+I send the same key codes. This makes it impossible to map them differently, for example in vim or nvim (which support this functionality: neovim/neovim#17932 (comment)).

If ms-terminal sent different key codes (like for example kitty or alacritty terminal), then it would be possible to map these keys to different functionalities in software running inside the terminal. This would enhance user experience and make it easier to migrate from the aforementioned terminals.

Proposed technical implementation details (optional)

@ghillb ghillb added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Aug 20, 2022
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 20, 2022
@zadjii-msft
Copy link
Member

Okay this sounds like we just need to support modifyOtherKeys. There was previous discussion in

From the docs

When modifyOtherKeys is set, ordinary keys may be sent as escape
sequences:

  • When modifyOtherKeys is set to 1, only the alt- and meta-modifiers
    apply. For example, alt-Tab sends CSI 2 7 ; 3 ; 9 ~ (the second
    parameter is "3" for alt, and the third parameter is the ASCII value
    of tab, "9").
  • When modifyOtherKeys is set to 2, all of the modifiers apply. For
    example, shift-Tab sends CSI 2 7 ; 2 ; 9 ~ rather than CSI Z (the
    second parameter is "2" for shift).

@zadjii-msft zadjii-msft added Product-Conhost For issues in the Console codebase Help Wanted We encourage anyone to jump in on these. Area-Input Related to input processing (key presses, mouse, etc.) Area-VT Virtual Terminal sequence support Issue-Task It's a feature request, but it doesn't really need a major design. labels Aug 22, 2022
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Aug 22, 2022
@zadjii-msft zadjii-msft added this to the Backlog milestone Aug 22, 2022
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Aug 22, 2022
@zadjii-msft zadjii-msft changed the title Send different key codes for Tab and Ctrl+I Send different key codes for Tab and Ctrl+I (READ: support modifyOtherKeys) Aug 22, 2022
@matthewgrossman
Copy link

Does anyone have a workaround for this problem in the interim?

My concrete issue: I have different mappings for <TAB> and <C-i> in neovim. In macOS, Kitty can differentiate just fine, but in Terminal on Windows (ubuntu wsl2) it seems to view them as the same input.

@AH-Merii
Copy link

Hi @zadjii-msft,

As the comment above mentioned, is there a temporary workaround that we can use while this issue is being worked on?

@zadjii-msft
Copy link
Member

You could probably manually add a sendInput action in the Terminal settings, bound to ctrl+I, that sends ~ some escape sequence ~, and then configure your editor to be bound to that escape sequence instead of just C-i.

What ~ some escape sequence ~ actually is would depend on the rest of your config, I'd reckon. I'm not super familiar with keybinding editing for neovim, so I don't really have a good end-to-end recommendation here, I'm afraid.

@AH-Merii
Copy link

No worries, thanks for pointing me in the right direction, I will look into it!

@AntonC9018
Copy link

It doesn't work by default for me on alacritty. In fact, it straight up ignores those key combos altogether.

If anyone has a working hack to fix this, making all of these keys be sent correctly, please share. It's a really draining issue for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Area-VT Virtual Terminal sequence support Help Wanted We encourage anyone to jump in on these. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conhost For issues in the Console codebase
Projects
None yet
Development

No branches or pull requests

5 participants