Terminal: Ability to disable some dead keys

Created on 7 May 2020  路  14Comments  路  Source: microsoft/terminal

Description of the new feature/enhancement

Feature: Ability to disable SOME dead keys.

Motivation

It might be hard to understand for people who have sensible layouts, but many keyboard layouts have dead keys that are very cumbersome when programming.

I personally use the terminal on the daily, and the tilde ~ is used a lot in Linux. On my AZERTY default layout, ~ acts as a dead key: i need to type it then add a space to get a single ~. See the layout below
image
~ needs ALTGR + 2 + space. This is exhausting. We also have a dead ^ that could use this feature.

Notes

  • Ubuntu provides very useful layouts made for coders, that disable the cumbersome dead keys: https://askubuntu.com/questions/56560/what-exactly-is-meant-by-eliminate-dead-keys . Windows doesn't provide this natively, thus this feature request (I would never expect this to be added to the main OS...)
  • Some people will say they use 帽 while coding, or 锚. Even if the Terminal has great:tm: support for UTF8, I'm not among them. I belive this is a tiny minority
  • I'm sure many people have that one dead key they wish they could get rid of. If this feature was builtin the terminal, it would allow a better coding experience for the people that only use those characters in the terminal anyways. This could also be profile based...

Do people also want that

For the user, It could be as simple a config value to disable dead keys using their key codes (?) such as

disable_dead_keys: [50]  # the 2/~ key code

Thanks a lot for you time, the Terminal is absolutely amazing and it just keeps getting better ! Cheers

Area-Input Area-TerminalControl Help Wanted Issue-Feature Needs-Tag-Fix Product-Terminal Resolution-Fix-Committed

Most helpful comment

:tada:Windows Terminal Preview v1.5.3142.0 has been released which incorporates this pull request.:tada:

Handy links:

All 14 comments

This doesn't seem entirely unreasonable to me. We might want to workshop how we specify these keys in json, but I think the idea sounds valid. I'm gonna summon our keyboard layout expert @lhecker to see if he's got any thoughts on the matter 鈽猴笍

(sorry for the long silence)

Yeah that's probably relatively easy to implement. Add a config setting like so (minus the UB I introduced), and add a && !disabledDeadKeys.contains(vkey) here.
I'd be able to implement that next weekend or so. 馃憤

Thanks a lot for looking into this !

I had the idea of adding a command called "passthrough" to the keybindings.
If you e.g. add a { "command": "passthrough", "keys": "~" }, binding it would then pass the key event (with the character ~) to the shell instead of deferring the event to the character event handler.
In order to support this I'd modify IKeyBindings::TryKeyChord to return a ternary instead of a boolean.
What do you think?

Ah! I forgot about this issue! While it's slightly cumbersome I believe this functionality can now be achieved in the v1.3 preview version using the new sendInput command.
If that's sufficient for you @gpotter2 would you like to try it out in the preview version?

It's working great ! The only issue now is that there is no way to register AltGR in the current key binders :/

The current key bninding interface doesn't make a distinction between left and right Ctrl/Alt.
We'll have to extend that interface and teach it to do so first. It'll also require adding logic to make it parse e.g. "LeftCtrl"/"RrightCtrl" and teach it that "Ctrl" is an alias for the presence of either of those keys. Only then can we alias "AltGr" as "RightAlt+LeftCtrl". Unfortunately that's clearly another feature that needs to implemented unrelated to both sendInput and this issue. 馃

Actually, there's an issue: it seems the dead key are not consumed (which is the whole point of this issue), even if made a shortcut.
For instance on my AZERTY keyboard, there's a ^ that is a dead key. If i use:

{ "command": { "action": "sendInput", "input": "b" }, "keys": "^" }

If i then press once the ^ key (which is a dead key) then a, I'll get:

b芒

I'll investigate this. 馃憤

Thanks a lot for your work on this !!!
鉂わ笍

:tada:This issue was addressed in #7686, which has now been successfully released as Windows Terminal v1.4.3141.0.:tada:

Handy links:

:tada:Windows Terminal v1.4.3141.0 has been released which incorporates this pull request.:tada:

Handy links:

:tada:This issue was addressed in #7686, which has now been successfully released as Windows Terminal Preview v1.5.3142.0.:tada:

Handy links:

:tada:Windows Terminal Preview v1.5.3142.0 has been released which incorporates this pull request.:tada:

Handy links:

Was this page helpful?
0 / 5 - 0 ratings