-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Feature request: Set IME input mode to English when a Windows Terminal window is opened #12731
Comments
If this is something that conhost already does, then this should be fairly trivial to implement for the Terminal, and it'd be all the precedent needed to do it. I'm worried that this is something that the IME does on behalf of conhost - detecting that conhost is the foreground window and then switching automatically. If that's the case, this might be quite a bit harder to fix, requiring a fix in the OS itself. |
I didn't go deep, but have done a little testing to try and solve the same problem. In terms of test results, there should be at least
Looks more like it's determined by the Microsoft Pinyin itself, especially the second. When I rename other programs like notepad.exe to cmd.exe, it will accept English input by default.
The input area window class of windows terminal is Windows.UI.Input.InputSite.WindowClass, The example in this link might be useful, but I didn't test it. |
Well, that's certainly great research! It's maybe a little troubling that this is something that seems to be outside our codebase. If this is something that's truly just a heuristic by Microsoft Pinyin, that just means it's gonna be less likely we can just patch that on our side. |
I think I found a way: in src\cascadia\TerminalControl\TSFInputControl.cpp:41: _editContext.InputScope(CoreTextInputScope::Text); Just simply change the
NOTICE: I have not actually tested the above code in this project, but completed the feasibility verification in another simple project which is just for testing, then I searched the entire microsoft/terminal project and found the only place InputScope appears and wrote this comment. |
I have actually verified in this project that Or to be on the safe side, make the inputScope customizable through the configuration file maybe a better choice, I can handle it if necessary. |
We can wait to see how users react. We only have to add a setting if they complain. 😄 Thanks! |
Modified the scope of input control, it used to be `Text`, now it is `AlphanumericHalfWidth`. This input scope actually accepts any characters, but English characters are preferred, and the soft keyboard also displays English by default. This should improve user friendliness for users using composition mode input methods. As a user who uses the composition mode input method, in applications like windows terminal that should usually be input in English, it is always required to manually switch to English mode by pressing Shift before entering commands. One keystroke is not a problem, but often for some reason there is no or no successful switching, and additional more keystrokes are required to clear the wrong input. The input method that comes with windows will automatically switch to English mode for a few programs such as conhost, but windows terminal is not in this list. This change should have no negative impact. Even if someone does tend to use a shell oriented towards composition characters or non-alpha letters, there should also were more users who in the same language are more inclined to English characters shells, for example, cmd, powershell, bash that comes with windows. If there's any reason to have to keep the Text inputScope, maybe making this setting customizable via `settings.json` would be a good idea, but I don't see the need to do this, `AlphanumericHalfWidth` is perfect. Closes #12731
🎉This issue was addressed in #13028, which has now been successfully released as Handy links: |
Description of the new feature/enhancement
I'm using the Microsoft Chinese IMEs, and when I open a Windows Terminal window, the input mode will be set to Chinese.
I know that's because the IME's "default mode" is set to Chinese (which is also the system default setting). If I change its "default mode" to English then the input mode will be English when I open Windows Terminal.
But I also noticed that even with the "default mode" set to Chinese, if you open Command Prompt (or other programs hosted by conhost.exe), the IME mode will still be switched to English, because users are more likely to input English texts.
So setting the input mode to English when Windows Terminal is launched would be helpful, as most command line texts are in English.
For Sougou Pinyin IME users: seems that Sougou Pinyin does not respect the "default input mode" set by those programs, because opening a Command Prompt window won't change its input mode to English.
I actually found a similar issue #1304 that further requested to restore input mode to English each time users hit Enter or Esc. That may be even better, although changing input mode so often might confuse some users. Personally I just want Windows Terminal to have English input mode on startup like what conhost does, so I can type in commands immediately.
The text was updated successfully, but these errors were encountered: