Make sure that key bindings work in all IMEs #8943

Closed
opened 2026-01-31 01:42:01 +00:00 by claunia · 17 comments
Owner

Originally created by @zh-impact on GitHub (Jun 9, 2020).

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]  
Platform ServicePack Version      VersionString 
-------- ----------- -------      ------------ 
Win32NT             10.0.19041.0 Microsoft Windows NT 10.0.19041.0

Windows Terminal version (if applicable):
1.0.1401.0

Any other software?

Steps to reproduce

ctrl+, open settings.json, find keybindings tutorial in microsoft docs
modify some keybindings like that:


{ "command": "openNewTabDropdown", "keys": "ctrl+shift+d" },        // will work
{ "command": "openNewTabDropdown", "keys": "ctrl+shift+space" }, // not work

 { "command": { "action": "newTab", "index": 0 }, "keys": "ctrl+1" },     // will work
 { "command": { "action": "newTab", "index": 1 }, "keys": "ctrl+2" },     // will work
 { "command": { "action": "newTab", "index": 2 }, "keys": "ctrl+shift+3" },     // not work
 { "command": { "action": "newTab", "index": 3 }, "keys": "ctrl+shift+4" },     // not work

Expected behavior

keybindings work properly

Actual behavior

some keybindings not work

settings.json

GitHub not support upload .json file, modify the extension to .txt
settings.txt

Originally created by @zh-impact on GitHub (Jun 9, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd] Platform ServicePack Version VersionString -------- ----------- ------- ------------ Win32NT 10.0.19041.0 Microsoft Windows NT 10.0.19041.0 Windows Terminal version (if applicable): 1.0.1401.0 Any other software? ``` # Steps to reproduce `ctrl+,` open settings.json, find keybindings tutorial in [microsoft docs](https://docs.microsoft.com/zh-cn/windows/terminal/customize-settings/key-bindings#tab-management-commands) modify some keybindings like that: ```json { "command": "openNewTabDropdown", "keys": "ctrl+shift+d" }, // will work { "command": "openNewTabDropdown", "keys": "ctrl+shift+space" }, // not work { "command": { "action": "newTab", "index": 0 }, "keys": "ctrl+1" }, // will work { "command": { "action": "newTab", "index": 1 }, "keys": "ctrl+2" }, // will work { "command": { "action": "newTab", "index": 2 }, "keys": "ctrl+shift+3" }, // not work { "command": { "action": "newTab", "index": 3 }, "keys": "ctrl+shift+4" }, // not work ``` <!-- A description of how to trigger this bug. --> # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> keybindings work properly # Actual behavior some keybindings not work <!-- What's actually happening? --> # settings.json GitHub not support upload .json file, modify the extension to .txt [settings.txt](https://github.com/microsoft/terminal/files/4754332/settings.txt)
Author
Owner

@DHowett commented on GitHub (Jun 10, 2020):

This is strange!
What keyboard layout are you using?

@DHowett commented on GitHub (Jun 10, 2020): This is strange! What keyboard layout are you using?
Author
Owner

@zh-impact commented on GitHub (Jun 10, 2020):


Resolved!
Conflicted with other shortcuts.
ctrl+shift+space conflict with IME shortcut ctrl+space Chinese/English mode toggle.
ctrl+shift+NUMBER, when I quit the most app, it worked, I need to find which app affected.
Wish to have some notify when keybindings have used by another application.


@DHowett I use US keyboard layout.
Just now, I discovered the effect of input methods on keybindings.
When I switch IME to English US. One of the keybindings worked.
微信截图_20200610134908

{ "command": "openNewTabDropdown", "keys": "ctrl+shift+d" },        // will work
{ "command": "openNewTabDropdown", "keys": "ctrl+shift+space" }, // will work under English US

but this still not work

 { "command": { "action": "newTab", "index": 2 }, "keys": "ctrl+shift+3" },     // not work  
 { "command": { "action": "newTab", "index": 3 }, "keys": "ctrl+shift+4" },     // not work

Before, I used the English status of Chinese input
微信截图_20200610135602
It may be that the input method has affected keybinds?

@zh-impact commented on GitHub (Jun 10, 2020): --- **Resolved!** Conflicted with other shortcuts. `ctrl+shift+space` conflict with IME shortcut `ctrl+space` Chinese/English mode toggle. `ctrl+shift+NUMBER`, when I quit the most app, it worked, I need to find which app affected. Wish to have some notify when keybindings have used by another application. --- @DHowett I use US keyboard layout. Just now, I discovered the effect of input methods on keybindings. When I switch IME to English US. One of the keybindings worked. ![微信截图_20200610134908](https://user-images.githubusercontent.com/4338052/84231937-d429c880-ab21-11ea-9c10-5d8b5c844d22.png) ```json { "command": "openNewTabDropdown", "keys": "ctrl+shift+d" }, // will work { "command": "openNewTabDropdown", "keys": "ctrl+shift+space" }, // will work under English US ``` but this still not work ```json { "command": { "action": "newTab", "index": 2 }, "keys": "ctrl+shift+3" }, // not work { "command": { "action": "newTab", "index": 3 }, "keys": "ctrl+shift+4" }, // not work ``` Before, I used the English status of Chinese input ![微信截图_20200610135602](https://user-images.githubusercontent.com/4338052/84232112-31257e80-ab22-11ea-8c93-ed15ba0bbf64.png) It may be that the input method has affected keybinds?
Author
Owner

@DHowett commented on GitHub (Jun 10, 2020):

I will reopen this issue, because we want to make sure that key bindings work in all IMEs :)

@DHowett commented on GitHub (Jun 10, 2020): I will reopen this issue, because we want to make sure that key bindings work in all IMEs :)
Author
Owner

@plastikfan commented on GitHub (Jun 12, 2020):

I have been using Terminal for a few weeks now, and suddenly key bindings hae changed with no apparent reason. I am using windows under bootcamp with an apple keyboard. This has been working fine. However getting access to the HASH key has always been problematic in this setup. Using <CTRL>+<ALT>+3, this worked fine and still does for all other apps. Suddenly though, <CTRL>+<ALT>+3, on Terminal, now (sometimes) switches the current tab to the 3rd tab. I'm not sure what it used to be because I don't often switch tabs via this key combo. What I do know is that I used to be able to type HASH easily with CA-3, now I can't. Here are my current bindings:

    "keybindings":
    [
        { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" },
        { "command": "paste", "keys": "ctrl+v" },

        { "command": "find", "keys": "ctrl+shift+f" },
        { "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "alt+shift+d" }
    ]

Note, there is nothing that controls tab switching here.

At https://docs.microsoft.com/en-gb/windows/terminal/customize-settings/key-bindings#open-a-specific-tab

I just discovered what is causing this mapping. However, I don't understand why this was not previously the case and why now it is in force. I would suggest that <CTRL>+<ALT><numbers 0-9> is a very bad idea, because they are often used for other essential purposes, such as HASH symbol on non US keyboards.

Also, because these are default bindings, it is not clear how to deactivate them. Because of this binding, I do not know how to get my HASH key back. Remove it? How, it's not configured because it's default.

I have just been force updated (yesterday I think) by windows, so maybe an update here has changed something subtle that I'm not aware of.

We so badly need that settings UI, instead of hacking a json file.

I just discovered, if I restart the app, then my HASH comes back. I would suggest there is a bug here that needs addressing.

@plastikfan commented on GitHub (Jun 12, 2020): I have been using Terminal for a few weeks now, and suddenly key bindings hae changed with no apparent reason. I am using windows under bootcamp with an apple keyboard. This has been working fine. However getting access to the HASH key has always been problematic in this setup. Using \<CTRL\>+\<ALT\>+3, this worked fine and still does for all other apps. Suddenly though, \<CTRL\>+\<ALT\>+3, on Terminal, now (sometimes) switches the current tab to the 3rd tab. I'm not sure what it used to be because I don't often switch tabs via this key combo. What I do know is that I used to be able to type HASH easily with CA-3, now I can't. Here are my current bindings: ```json "keybindings": [ { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" }, { "command": "paste", "keys": "ctrl+v" }, { "command": "find", "keys": "ctrl+shift+f" }, { "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "alt+shift+d" } ] ``` Note, there is nothing that controls tab switching here. At https://docs.microsoft.com/en-gb/windows/terminal/customize-settings/key-bindings#open-a-specific-tab I just discovered what is causing this mapping. However, I don't understand why this was not previously the case and why now it is in force. I would suggest that \<CTRL\>+\<ALT\>\<numbers 0-9\> is a very bad idea, because they are often used for other essential purposes, such as HASH symbol on non US keyboards. Also, because these are default bindings, it is not clear how to deactivate them. Because of this binding, I do not know how to get my HASH key back. Remove it? How, it's not configured because it's default. I have just been force updated (yesterday I think) by windows, so maybe an update here has changed something subtle that I'm not aware of. We so badly need that settings UI, instead of hacking a json file. I just discovered, if I restart the app, then my HASH comes back. I would suggest there is a bug here that needs addressing.
Author
Owner

@JonathanBergendahl commented on GitHub (May 6, 2021):

I am having the same issue using ctrl+shift+c but ctrl+t and ctrl+shift+v works.

Settings.json
image

@JonathanBergendahl commented on GitHub (May 6, 2021): I am having the same issue using ctrl+shift+c but ctrl+t and ctrl+shift+v works. Settings.json ![image](https://user-images.githubusercontent.com/40280149/117348190-36ae5480-aeaa-11eb-93cd-9e50dfe03dd3.png)
Author
Owner

@zadjii-msft commented on GitHub (May 6, 2021):

I am having the same issue using ctrl+shift+v but ctrl+t and ctrl+shift+v works.

I'm sorry what now? You've got an issue with ctrl+shift+v, but ctrl+shift+v works?

@zadjii-msft commented on GitHub (May 6, 2021): > I am having the same issue using ctrl+shift+v but ctrl+t and ctrl+shift+v works. I'm sorry what now? You've got an issue with `ctrl+shift+v`, but `ctrl+shift+v` works?
Author
Owner

@JonathanBergendahl commented on GitHub (May 6, 2021):

I am having the same issue using ctrl+shift+v but ctrl+t and ctrl+shift+v works.

I'm sorry what now? You've got an issue with ctrl+shift+v, but ctrl+shift+v works?

Sorry I mistyped I meant that ctrl+shift+c doesn't work.

@JonathanBergendahl commented on GitHub (May 6, 2021): > > > > I am having the same issue using ctrl+shift+v but ctrl+t and ctrl+shift+v works. > > I'm sorry what now? You've got an issue with `ctrl+shift+v`, but `ctrl+shift+v` works? Sorry I mistyped I meant that ctrl+shift+c doesn't work.
Author
Owner

@zadjii-msft commented on GitHub (May 6, 2021):

That's incredibly weird. copy will only work when text is selected, but maybe something weird has messed that up.

  • What version of the Terminal are you using?
  • Do you have copyOnSelect enabled?
  • What does the "Copy Text" action look like in the settings UI?
  • What shell/application are you running in the Terminal?

This original issue is pretty narrow in scope, specific to how keybindings work with IMEs. It might be best to open a new thread to track your particular issue.

@zadjii-msft commented on GitHub (May 6, 2021): That's incredibly weird. `copy` will only work when text is selected, but maybe something weird has messed that up. * What version of the Terminal are you using? * Do you have `copyOnSelect` enabled? * What does the "Copy Text" action look like in the settings UI? * What shell/application are you running in the Terminal? This original issue is pretty narrow in scope, specific to how keybindings work with IMEs. It might be best to open a new thread to track your particular issue.
Author
Owner

@JonathanBergendahl commented on GitHub (May 6, 2021):

The left one is the normal one and the right one the preview build.

image

I have automatically copy on select off on both.

image

I tried using Kali, powershell and cmd.
image
image

@JonathanBergendahl commented on GitHub (May 6, 2021): The left one is the normal one and the right one the preview build. ![image](https://user-images.githubusercontent.com/40280149/117362375-76ca0300-aebb-11eb-8147-39b7c96a3f90.png) I have automatically copy on select off on both. ![image](https://user-images.githubusercontent.com/40280149/117362492-9e20d000-aebb-11eb-9b80-c9ff17bcf0c8.png) I tried using Kali, powershell and cmd. ![image](https://user-images.githubusercontent.com/40280149/117362641-cd374180-aebb-11eb-8633-a07c96d0243b.png) ![image](https://user-images.githubusercontent.com/40280149/117362693-de804e00-aebb-11eb-9ca6-326f1530558a.png)
Author
Owner

@zadjii-msft commented on GitHub (May 6, 2021):

Bizarre. I wonder if the Terminal is getting the keystroke at all, or if something else is globally stealing the key.

  • If you run showkey -a in your kali linux instance, then press ctrl+shift+c, what does that output?
  • If you select that text, then press ctrl+shift+c again, what does that output?
@zadjii-msft commented on GitHub (May 6, 2021): Bizarre. I wonder if the Terminal is getting the keystroke at all, or if something else is globally stealing the key. * If you run `showkey -a` in your kali linux instance, then press <kbd>ctrl+shift+c</kbd>, what does that output? * If you select that text, then press <kbd>ctrl+shift+c</kbd> again, what does that output?
Author
Owner

@JonathanBergendahl commented on GitHub (May 6, 2021):

When I run it using showkey neither ctrl+shift+v, ctrl+shift+c or ctrl+shift+t shows up but then line indicator stops blinking for a littel. I can also use ctrl+shift+v without it showing up and still pasting the text into the window.

image

@JonathanBergendahl commented on GitHub (May 6, 2021): When I run it using showkey neither ctrl+shift+v, ctrl+shift+c or ctrl+shift+t shows up but then line indicator stops blinking for a littel. I can also use ctrl+shift+v without it showing up and still pasting the text into the window. ![image](https://user-images.githubusercontent.com/40280149/117363982-a7ab3780-aebd-11eb-87e3-5cc092af63c8.png)
Author
Owner

@zadjii-msft commented on GitHub (May 6, 2021):

Well, if you're not seeing ctrl+shift+c show up in showkey, and it's not copying the text from the terminal (when a selection is active), then I'd reckon that the Terminal is never even getting that keystroke. I'd be something else running on your machine is stealing the keystroke, but I'm not sure there's any way of determining that.

@zadjii-msft commented on GitHub (May 6, 2021): Well, if you're not seeing <kbd>ctrl+shift+c</kbd> show up in `showkey`, and it's not copying the text from the terminal (when a selection is active), then I'd reckon that the Terminal is never even getting that keystroke. I'd be something else running on your machine is stealing the keystroke, but I'm not sure there's any way of determining that.
Author
Owner

@JonathanBergendahl commented on GitHub (May 6, 2021):

Well, if you're not seeing ctrl+shift+c show up in showkey, and it's not copying the text from the terminal (when a selection is active), then I'd reckon that the Terminal is never even getting that keystroke. I'd be something else running on your machine is stealing the keystroke, but I'm not sure there's any way of determining that.

I finally found it. The AMD Radeon Software took up that bind and for some reason it only happened in the windows terminal... :/

@JonathanBergendahl commented on GitHub (May 6, 2021): > > > Well, if you're not seeing ctrl+shift+c show up in `showkey`, and it's not copying the text from the terminal (when a selection is active), then I'd reckon that the Terminal is never even getting that keystroke. I'd be something else running on your machine is stealing the keystroke, but I'm not sure there's any way of determining that. I finally found it. The AMD Radeon Software took up that bind and for some reason it only happened in the windows terminal... :/
Author
Owner

@zadjii-msft commented on GitHub (May 6, 2021):

@JonathanBergendahl Glad you were able to figure it out!

@zadjii-msft commented on GitHub (May 6, 2021): @JonathanBergendahl Glad you were able to figure it out!
Author
Owner

@lhecker commented on GitHub (Mar 13, 2022):

Just now, I discovered the effect of input methods on keybindings.
When I switch IME to English US. One of the keybindings worked.

I think that part should work now with the introduction of #10876, which was released in Windows Terminal 1.11.

@lhecker commented on GitHub (Mar 13, 2022): > Just now, I discovered the effect of input methods on keybindings. > When I switch IME to English US. One of the keybindings worked. I think that part should work now with the introduction of #10876, which was released in Windows Terminal 1.11.
Author
Owner

@zadjii-msft commented on GitHub (Mar 29, 2024):

(also cross-linking: #15598. ctrl+shift+f for find doesn't work with the Microsoft Pinyin IME)

@zadjii-msft commented on GitHub (Mar 29, 2024): (also cross-linking: #15598. ctrl+shift+f for find doesn't work with the Microsoft Pinyin IME)
Author
Owner

@zadjii-msft commented on GitHub (Jun 10, 2024):

We discussed this a little while back, and we've come to the conclusion as a team that it's going to be practically impossible for us to avoid conflicts with all keys bound in all possible software that someone might be using with the Terminal. We will try our best to stick to ctrl+shift modifiers for keys we bind in our default settings, to avoid conflicts with CLI apps. And we'll always let users change bindings for keys on their own. But there's not much else we can do here to try and avoid the gambit of other things that might also bind keys.

@zadjii-msft commented on GitHub (Jun 10, 2024): We discussed this a little while back, and we've come to the conclusion as a team that it's going to be practically impossible for us to avoid conflicts with all keys bound in all possible software that someone might be using with the Terminal. We will try our best to stick to ctrl+shift modifiers for keys we bind in our default settings, to avoid conflicts with CLI apps. And we'll always let users change bindings for keys on their own. But there's not much else we can do here to try and avoid the gambit of other things that might also bind keys.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8943