-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
IME fails very frequently in the v0.10 release #5054
Comments
Just curious, what's the version of Windows you're running? |
@etern I've managed to half repro the issue you're seeing (my work machine can't repro, but my personal PC can repro part of the bug), so I'm not sure if I'm fixing the exact issue you're seeing. I have a potential fix in the branch named |
@leonMSFT My Windows version is 10.0.18362.476. If you can fix this, you might know how it can be triggered (hope it's not random behavior). I can verify the trigger method on my PC, so we know if you fixed the right problem. If that doesn't help, I will try to build your branch by this weekend. Since I'm not familiar with the code, I don't have the confidence to make it work |
I believe the trigger is to start composition with something like "wei'yua" but backspace delete your composition completely before you complete the composition. After deleting the composition, try creating a composition again and nothing will show up but the composition picker box will show and update as if you're typing normally. |
Yes, "delete composition completely" can reproduce the bug every time, you get it right. Please merge the fix. |
Actually, I have one more follow up question: after deleting the composition "wei'yuan", does the starting letter 'w' reappear? |
Yes, the first character reappear |
I can reproduce this easily on my laptop with Windows 10.0.18363.720 and Windows Terminal at a338227 under two different circumstances:
@leonMSFT Your fix seems to be working with both cases. But the reappearing is still there, which I suppose is something you are aware of. |
Yeah the reappearing character is a particularly annoying problem. For some reason, I'm receiving a |
I've made a PR to at the very least allow y'all to continue typing in Chinese IME, but I haven't come up with a way to resolve the reappearing initial character due to not understanding why the text server API must act this way 😢 |
## Summary of the Pull Request This PR fixes an out of bounds access when deleting composition during Chinese IME. What's happening is that we're receiving a CompositionCompleted before receiving the TextUpdate to tell us to delete the last character in the composition. This creates two problems for us: 1. The final character gets sent to the Terminal when it should have been deleted. 2. `_activeTextStart` gets set to `_inputBuffer.length()` when sending the character to the terminal, so when the `TextUpdate` comes right after the `CompositionCompleted` event, `_activeTextStart` is out of sync. This PR fixes the second issue, by updating `_activeTextStart` during a `TextUpdate` in case we run into this issue. The first issue is trickier to resolve since we assume that if the text server api tells us a composition is completed, we should send what we have. It'll be tracked here: #5110. At the very least, this PR will let users continue to type in Chinese IME without it breaking, but it will still be annoying to see the first letter of your composition reappear after deleting it. ## PR Checklist * [x] Closes #5054 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed ## Validation Steps Performed Play around with Chinese IME deleting and composing, and play around with Korean and Japanese IME to see that it still works as expected.
🎉This issue was addressed in #5109, which has now been successfully released as Handy links: |
In the middle of typing, IME frequently fails, I tried but still can't figure out how the failure is triggered, but only if I type and delete for a while, it always happen, so I get the chance to record a gif:
From the gif, you can see the first two characters were typed correctly, after that, nothing from the IME can be typed again.
Environment
Microsoft Windows [版本 10.0.18362.476]
The gif is recorded in v0.10.761.0, and it still happens in v0.10.781.0
I have been using Terminal v0.9, which works fine, the error comes with v0.10
Steps to reproduce
Can't figure out exactly, keep typing and deleting in a prompt for a while, it always happen
Expected behavior
characters from IME can be typd onto terminal
Actual behavior
IME fails
The text was updated successfully, but these errors were encountered: