IME mode changed at startup in Google Japanese Input #18917

Closed
opened 2026-01-31 06:28:20 +00:00 by claunia · 17 comments
Owner

Originally created by @kzrnm on GitHub (Nov 18, 2022).

Windows Terminal version

1.15.2874.0

Windows build number

10.0.19045.0

Other Software

Google 日本語入力 (2.28.4650.0)

Steps to reproduce

Start Windows Terminal with Japanese IME.

Expected Behavior

Google IME selects 直接入力(Direct input) mode.
MS IME selects 半角英数字/直接入力(Direct input) mode.

Actual Behavior

Google IME selects 半角英数(English input with IME) mode.
MS IME selects 半角英数字/直接入力(Direct input) mode.

Originally created by @kzrnm on GitHub (Nov 18, 2022). ### Windows Terminal version 1.15.2874.0 ### Windows build number 10.0.19045.0 ### Other Software Google 日本語入力 (2.28.4650.0) ### Steps to reproduce Start Windows Terminal with Japanese IME. ### Expected Behavior Google IME selects `直接入力`(Direct input) mode. MS IME selects `半角英数字/直接入力`(Direct input) mode. ### Actual Behavior Google IME selects `半角英数`(English input with IME) mode. MS IME selects `半角英数字/直接入力`(Direct input) mode.
Author
Owner

@zadjii-msft commented on GitHub (Nov 18, 2022):

Hmm. linking threads:

@zadjii-msft commented on GitHub (Nov 18, 2022): Hmm. linking threads: * #13398 - I thought we fixed this one... * #13678 * #13681 * #13805
Author
Owner

@weiqi-chen commented on GitHub (Nov 20, 2022):

Not only Japanese, but also Chinese.

issue

@weiqi-chen commented on GitHub (Nov 20, 2022): Not only Japanese, but also Chinese. ![issue](https://user-images.githubusercontent.com/6562920/202912680-76f246a9-9c2b-4d1b-9f88-3e575cc8ad5c.gif)
Author
Owner

@yonta commented on GitHub (Nov 22, 2022):

Same issue is reported at Gborad Help.
https://support.google.com/gboard/thread/180438722/windows-terminal-%E8%B5%B7%E5%8B%95%E6%99%82%E3%81%AE-%E5%85%A5%E5%8A%9B%E6%96%B9%E6%B3%95-%E3%81%AB%E9%96%A2%E3%81%99%E3%82%8B%E4%B8%8D%E5%85%B7%E5%90%88?hl=ja

Expert says that Microsft IME has one state "半角英数字/直接入力" (direct input) but Google Japanese Input and Legacy Microsoft IME has "半角英数" (English input) and "直接入力" (direct input) as separated state.

補足情報として
現行の Microsoft IME は機能が少なく「半角英数字/直接入力」が一つの状態となっています。
Google 日本語入力や、以前のバージョンの Microsoft IME においては、「半角英数」「直接入力」が別の状態として存在しています。

I think Windows Terminal incorrectly specifies input method at startup.

@yonta commented on GitHub (Nov 22, 2022): Same issue is reported at Gborad Help. https://support.google.com/gboard/thread/180438722/windows-terminal-%E8%B5%B7%E5%8B%95%E6%99%82%E3%81%AE-%E5%85%A5%E5%8A%9B%E6%96%B9%E6%B3%95-%E3%81%AB%E9%96%A2%E3%81%99%E3%82%8B%E4%B8%8D%E5%85%B7%E5%90%88?hl=ja Expert says that Microsft IME has one state "半角英数字/直接入力" (direct input) but Google Japanese Input and Legacy Microsoft IME has "半角英数" (English input) and "直接入力" (direct input) as separated state. > 補足情報として 現行の Microsoft IME は機能が少なく「半角英数字/直接入力」が一つの状態となっています。 Google 日本語入力や、以前のバージョンの Microsoft IME においては、「半角英数」「直接入力」が別の状態として存在しています。 I think Windows Terminal incorrectly specifies input method at startup.
Author
Owner

@cumet04 commented on GitHub (Dec 26, 2022):

I have same issue, and v1.14.186 reproduces the issue but v1.13.1143 doesn't.

@cumet04 commented on GitHub (Dec 26, 2022): I have same issue, and [v1.14.186](https://github.com/microsoft/terminal/releases/tag/v1.14.1861.0) reproduces the issue but [v1.13.1143](https://github.com/microsoft/terminal/releases/tag/v1.13.11431.0) doesn't.
Author
Owner

@carlos-zamora commented on GitHub (Jan 25, 2023):

Marking this as a feature. We've had reports in the past of users wanting this kind of behavior. Sounds like the right path forward is to make this a configurable setting.

@carlos-zamora commented on GitHub (Jan 25, 2023): Marking this as a feature. We've had reports in the past of users wanting this kind of behavior. Sounds like the right path forward is to make this a configurable setting.
Author
Owner

@siketyan commented on GitHub (Feb 1, 2023):

@carlos-zamora
For clarification, does the user really want to switch to alphanumeric input mode (with IME ON: this is usually not useful in terminals)? I can not imagine why they want the behaviour. I think almost all users of terminals want direct input with IME OFF, not alphanumeric input mode.

If there are some usecases that users want to switch to that mode, I think it is the right way to make it configurable too.

@siketyan commented on GitHub (Feb 1, 2023): @carlos-zamora For clarification, does the user _really_ want to switch to alphanumeric input mode (**with IME ON**: this is usually _not_ useful in terminals)? I can not imagine why they want the behaviour. I think almost all users of terminals want direct input with IME OFF, not alphanumeric input mode. If there are some usecases that users want to switch to that mode, I think it is the right way to make it configurable too.
Author
Owner

@usagi commented on GitHub (May 25, 2023):

The cause appears to be https://github.com/microsoft/terminal/pull/13028. In this PR, it is declared that

This change should have no negative impact.

and

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.

However, as this issue shows, this feature can have extremely unpleasant side effects depending on the environment. As @carlos-zamora suggests, I strongly agree that there is a need to add settings that allow users to easily switch this feature ON/OFF.

@usagi commented on GitHub (May 25, 2023): The cause appears to be https://github.com/microsoft/terminal/pull/13028. In this PR, it is declared that > This change should have no negative impact. and > 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. However, as this issue shows, this feature can have extremely unpleasant side effects depending on the environment. As @carlos-zamora suggests, I strongly agree that there is a need to add settings that allow users to easily switch this feature ON/OFF.
Author
Owner

@ikeyan commented on GitHub (Jun 7, 2023):

Original issue #12731 says:

Personally I just want Windows Terminal to have English input mode on startup like what conhost does, so I can type in commands immediately.

So the author expected that users could immediately start typing commands at startup, but this is hampered by this issue.

@ikeyan commented on GitHub (Jun 7, 2023): Original issue #12731 says: > Personally I just want Windows Terminal to have English input mode on startup like what conhost does, so I can type in commands immediately. So the author expected that users could immediately start typing commands at startup, but this is hampered by this issue.
Author
Owner

@weiqi-chen commented on GitHub (Jun 7, 2023):

Original issue #12731 says:

Personally I just want Windows Terminal to have English input mode on startup like what conhost does, so I can type in commands immediately.

So the author expected that users could immediately start typing commands at startup, but this is hampered by this issue.

I add two keyboard layout, one is english, another one is chinese. If I need to input english / chinese, I use Alt + Shift to switch the keyboard。 When I fell like to use Chinese keyboard to type english and chinese, I would use Shift key to enable/disable Chinese Pinyin. I don't like it that Windows Terminal do it(switch to english) every single time after I pressing Enter key, even I don't need to switch to english.

@weiqi-chen commented on GitHub (Jun 7, 2023): > Original issue #12731 says: > > > Personally I just want Windows Terminal to have English input mode on startup like what conhost does, so I can type in commands immediately. > > So the author expected that users could immediately start typing commands at startup, but this is hampered by this issue. I add two keyboard layout, one is english, another one is chinese. If I need to input english / chinese, I use `Alt + Shift` to switch the keyboard。 When I fell like to use Chinese keyboard to type english and chinese, I would use `Shift` key to enable/disable Chinese Pinyin. I don't like it that Windows Terminal do it(switch to english) every single time after I pressing Enter key, even I don't need to switch to english.
Author
Owner

@siketyan commented on GitHub (Jun 8, 2023):

I now think this can be considered as Google IME's issue.
In #13028, it is added to change CoreTextInputScope once Windows Terminal is loaded.
The InputScope does not mean IME should be turned on or off on the text input, so the decision is delegated to IMEs.

In Microsoft IME, CoreTextInputScope::AlphanumericHalfWidth is mapped to Direct Input mode, so it is okay for us.

But in Google IME or Mozc, the scope is mapped to Alphanumeric mode with IME on, causing this issue. It is documented in Mozc repository:
https://github.com/google/mozc/blob/master/docs/design_doc/input_scope.md

Quote:

InputScope Expected Input Mode
IS_URL, IS_EMAIL_USERNAME, IS_EMAIL_SMTPEMAILADDRESS, IS_DIGITS, IS_NUMBER, IS_PASSWORD, IS_TELEPHONE_FULLTELEPHONENUMBER, IS_TELEPHONE_COUNTRYCODE, IS_TELEPHONE_AREACODE, IS_TELEPHONE_LOCALNUMBER, IS_TIME_FULLTIME, IS_TIME_HOUR, IS_TIME_MINORSEC Direct Mode (IME Off)
IS_ALPHANUMERIC_HALFWIDTH Halfwidth Alphanumeric Mode (IME On)

As described above, Google IME and Mozc consider IME should be turned on in text inputs with AlphanumericHalfWidth scope.

I am not familier with UWP, but isn't there a way to turn IME off without depending on the InputScope?

@siketyan commented on GitHub (Jun 8, 2023): I now think this can be considered as Google IME's issue. In #13028, it is added to change CoreTextInputScope once Windows Terminal is loaded. The InputScope does not mean IME should be turned on or off on the text input, so the decision is delegated to IMEs. In Microsoft IME, CoreTextInputScope::AlphanumericHalfWidth is mapped to Direct Input mode, so it is okay for us. But in Google IME or Mozc, the scope is mapped to Alphanumeric mode with IME on, causing this issue. It is documented in Mozc repository: https://github.com/google/mozc/blob/master/docs/design_doc/input_scope.md Quote: | InputScope | Expected Input Mode | |:-----------|:--------------------| | `IS_URL`, `IS_EMAIL_USERNAME`, `IS_EMAIL_SMTPEMAILADDRESS`, `IS_DIGITS`, `IS_NUMBER`, `IS_PASSWORD`, `IS_TELEPHONE_FULLTELEPHONENUMBER`, `IS_TELEPHONE_COUNTRYCODE`, `IS_TELEPHONE_AREACODE`, `IS_TELEPHONE_LOCALNUMBER`, `IS_TIME_FULLTIME`, `IS_TIME_HOUR`, `IS_TIME_MINORSEC` | Direct Mode (IME Off) | | `IS_ALPHANUMERIC_HALFWIDTH` | Halfwidth Alphanumeric Mode (IME On) | As described above, Google IME and Mozc consider IME should be turned on in text inputs with AlphanumericHalfWidth scope. I am not familier with UWP, but isn't there a way to turn IME off without depending on the InputScope?
Author
Owner

@gexgd0419 commented on GitHub (Feb 20, 2024):

I tested the built-in CJK IMEs in Windows XP, 7, and 11.

Chinese IME

Windows XP's version: "IME off" and "IME on, but English mode" are different states. When the IME is on, you can switch between Chinese/English with Shift keys, but when the IME is off you can't. Other than that, those two modes are similar: both modes just pass the English key input without interception, similar to "direct input".

Windows 7's version: those two modes are merged. "Turning off IME" is interpreted as "switching to English mode". And when the IME is in English mode, it will report that it is off.

Windows 11's version: "Turning off IME" is interpreted as "switching to English mode". However, the IME always reports that it is on.

Some third-party Chinese IMEs follow the XP's behavior. If they are turned off, they behave as if they are "disabled": the IME bar is hidden, and you cannot use Shift keys or other hot keys to bring them back, until you switch to another IME then switch back.

Japanese IME

Windows XP's version: "IME off" and "IME on, but half-width alphanumeric mode" are different states. "IME off" is also known as the "direct input" mode. In half-width alphanumeric mode, English input is not converted, but is still intercepted.

Windows 7/11's version: those two modes are merged. There's no "direct input" mode anymore, only "half-width alphanumeric" mode. When in this mode, the IME reports that it is off.

Korean IME

Windows XP's version: reports that it is on or off depending on whether it's in Korean mode, but you cannot turn it on or off. You have to change the conversion mode.

Windows 7's version: reports that it is on or off depending on whether it's in Korean mode. Turning it on or off appears to change its state, but in fact the mode is not changed.

Windows 11's version: reports that it is on or off depending on whether it's in Korean mode. You can turn the IME on or off to switch between Korean/English mode. (But sometimes it doesn't work)

Conclusion

If the user is using Chinese or Korean IME, the conversion mode should be changed. This can be done via ImmSetConversionStatus, or sending a WM_IME_CONTROL with wParam = IMC_SETCONVERSIONMODE (0x2) to the IME window returned from ImmGetDefaultIMEWnd.

If the user is using Japanese IME, the IME should be turned off. This can be done via ImmSetOpenStatus, or sending a WM_IME_CONTROL with wParam = IMC_SETOPENSTATUS (0x6) to the IME window.

It seems that there isn't a corresponding InputScope value for the "IME off" state, though.

@gexgd0419 commented on GitHub (Feb 20, 2024): I tested the built-in CJK IMEs in Windows XP, 7, and 11. ## Chinese IME Windows XP's version: "IME off" and "IME on, but English mode" are different states. When the IME is on, you can switch between Chinese/English with Shift keys, but when the IME is off you can't. Other than that, those two modes are similar: both modes just pass the English key input without interception, similar to "direct input". Windows 7's version: those two modes are merged. "Turning off IME" is interpreted as "switching to English mode". And when the IME is in English mode, it will report that it is off. Windows 11's version: "Turning off IME" is interpreted as "switching to English mode". However, the IME always reports that it is on. Some third-party Chinese IMEs follow the XP's behavior. If they are turned off, they behave as if they are "disabled": the IME bar is hidden, and you cannot use Shift keys or other hot keys to bring them back, until you switch to another IME then switch back. ## Japanese IME Windows XP's version: "IME off" and "IME on, but half-width alphanumeric mode" are different states. "IME off" is also known as the "direct input" mode. In half-width alphanumeric mode, English input is not converted, but is still intercepted. Windows 7/11's version: those two modes are merged. There's no "direct input" mode anymore, only "half-width alphanumeric" mode. When in this mode, the IME reports that it is off. ## Korean IME Windows XP's version: reports that it is on or off depending on whether it's in Korean mode, but you cannot turn it on or off. You have to change the conversion mode. Windows 7's version: reports that it is on or off depending on whether it's in Korean mode. Turning it on or off appears to change its state, but in fact the mode is not changed. Windows 11's version: reports that it is on or off depending on whether it's in Korean mode. You can turn the IME on or off to switch between Korean/English mode. (But sometimes it doesn't work) ## Conclusion If the user is using Chinese or Korean IME, the [conversion mode](https://learn.microsoft.com/en-us/windows/win32/intl/ime-conversion-mode-values) should be changed. This can be done via [ImmSetConversionStatus](https://learn.microsoft.com/en-us/windows/win32/api/imm/nf-imm-immsetconversionstatus), or sending a [WM_IME_CONTROL](https://learn.microsoft.com/en-us/windows/win32/intl/wm-ime-control) with wParam = `IMC_SETCONVERSIONMODE (0x2)` to the IME window returned from [ImmGetDefaultIMEWnd](https://learn.microsoft.com/en-us/windows/win32/api/imm/nf-imm-immgetdefaultimewnd). If the user is using Japanese IME, the IME should be turned off. This can be done via [ImmSetOpenStatus](https://learn.microsoft.com/en-us/windows/win32/api/imm/nf-imm-immsetopenstatus), or sending a WM_IME_CONTROL with wParam = `IMC_SETOPENSTATUS (0x6)` to the IME window. It seems that there isn't a corresponding InputScope value for the "IME off" state, though.
Author
Owner

@yukawa commented on GitHub (Mar 13, 2024):

A Google Japanese Input / Mozc maintainer here.

If you are/were using Google Japanese Input for Windows and had been affected by this particular issue, it should no longer happen with Google Japanese Input version 2.29.5268.100 and later, which contain the following commit.

As far as Google Japanese Input is concerned, I believe no further change in the Windows Terminal side is needed.

Just for your reference, here are currently released versions as of writing.

  • Google Japanese Input for Windows stable channel: 2.29.5374.100
  • Google Japanese Input for Windows dev channel: 2.29.5370.0
@yukawa commented on GitHub (Mar 13, 2024): A Google Japanese Input / Mozc maintainer here. If you are/were using Google Japanese Input for Windows and had been affected by this particular issue, it should no longer happen with Google Japanese Input version `2.29.5268.100` and later, which contain the following commit. * https://github.com/google/mozc/commit/58a3c22383f6d6f987a7a28a4b6a7fe1d9ac992e As far as Google Japanese Input is concerned, I believe no further change in the Windows Terminal side is needed. Just for your reference, here are currently released versions as of writing. * Google Japanese Input for Windows stable channel: `2.29.5374.100` * Google Japanese Input for Windows dev channel: `2.29.5370.0`
Author
Owner

@PseudoResonance commented on GitHub (Mar 13, 2024):

The latest update seems to have fixed the issue for me, however the "About Google Japanese Input" page is blank, so I'm not sure what version I'm on... (Edit: Using the method below, I see it's 2.29.5370) I was on 2.28 previously which I downloaded about 2 weeks ago. Thank you for the heads up!
image

@PseudoResonance commented on GitHub (Mar 13, 2024): The latest update seems to have fixed the issue for me, however the "About Google Japanese Input" page is blank, so I'm not sure what version I'm on... (Edit: Using the method below, I see it's 2.29.5370) I was on 2.28 previously which I downloaded about 2 weeks ago. Thank you for the heads up! ![image](https://github.com/microsoft/terminal/assets/7216500/889a4e0d-2056-40fb-a4f2-f9fabd084534)
Author
Owner

@vyv03354 commented on GitHub (Mar 13, 2024):

The latest update seems to have fixed the issue for me, however the "About Google Japanese Input" page is blank, so I'm not sure what version I'm on...

Me too, it's probably because your (and my) system is using Dark Mode. The dialog uses system-default text color (white in Dark Mode) with custom background, I guess.

@vyv03354 commented on GitHub (Mar 13, 2024): > The latest update seems to have fixed the issue for me, however the "About Google Japanese Input" page is blank, so I'm not sure what version I'm on... Me too, it's probably because your (and my) system is using Dark Mode. The dialog uses system-default text color (white in Dark Mode) with custom background, I guess.
Author
Owner

@vyv03354 commented on GitHub (Mar 14, 2024):

You can verify the version by converting the word "ばーじょん" on Google Japanese Input.

@vyv03354 commented on GitHub (Mar 14, 2024): You can verify the version by converting the word "ばーじょん" on Google Japanese Input.
Author
Owner

@yukawa commented on GitHub (Mar 14, 2024):

The latest update seems to have fixed the issue for me, however the "About Google Japanese Input" page is blank, so I'm not sure what version I'm on... (Edit: Using the method below, I see it's 2.29.5370) I was on 2.28 previously which I downloaded about 2 weeks ago. Thank you for the heads up!

Sorry about the trouble. I've filed the following issue to keep track of the above issue.

Thanks!

@yukawa commented on GitHub (Mar 14, 2024): > The latest update seems to have fixed the issue for me, however the "About Google Japanese Input" page is blank, so I'm not sure what version I'm on... (Edit: Using the method below, I see it's 2.29.5370) I was on 2.28 previously which I downloaded about 2 weeks ago. Thank you for the heads up! Sorry about the trouble. I've filed the following issue to keep track of the above issue. * https://github.com/google/mozc/issues/897 Thanks!
Author
Owner

@lhecker commented on GitHub (Apr 18, 2024):

We just published a major update to our IME implementation in the nightly Canary branch. It was rewritten from the ground up and has tons of improvements! If you're interested in trying it out, you can get it here: https://aka.ms/terminal-canary-installer
If you already have the Canary build installed, you can use this link to force an update.

If you encounter any issues or have any suggestions, or if you simply like/dislike the changes, please let us know! Thank you for bearing with us. 😊

@lhecker commented on GitHub (Apr 18, 2024): We just published a major update to our IME implementation in the nightly Canary branch. It was rewritten from the ground up and has tons of improvements! If you're interested in trying it out, you can get it here: https://aka.ms/terminal-canary-installer If you already have the Canary build installed, you can use this link to force an update. If you encounter any issues or have any suggestions, or if you simply like/dislike the changes, please let us know! Thank you for bearing with us. 😊
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18917