Terminal: Character Overlap during Korean IME Composition

Created on 17 Mar 2020  Β·  9Comments  Β·  Source: microsoft/terminal

Environment

Windows version

Microsoft Windows [Version 10.0.18362.720]

Terminal version

Version: 0.10.761.0

Steps to reproduce

  1. Open "Terminal" app
  2. Type "ν…ŒμŠ€νŠΈ" (It means test in Korean)
  3. You can probably see the letters overlapping

Expected behavior

Rather than a long explanation, I'd rather attach the behavior of another operating system terminal.

macos_terminal

In the case of MacOS, the cursor is positioned under the letter being combined during the Korean language composition process, and there is no collision of letters.

linux_terminal

In the Ubuntu 18.04 X Window system environment, if the same operation is performed in the terminal, You can expect that Hangul characters are under the composition process in a cursor shape. And the Hangul characters do not overlap.

Actual behavior

windows_terminal

In Version: 0.10.761.0, there is a problem that the Korean characters are overlapped as shown in the picture above.

If this problem is expected to be relatively minor by the core development team, please give a hint to the source code that is expected to be a problem so that I can give you a PR.

Area-Input Area-TerminalControl Help Wanted Issue-Bug Priority-1 Product-Terminal Resolution-Fix-Committed

Most helpful comment

Please don’t apologize! You were definitely not a blocker, as I was working on some other bugs in the meantime anyway. I was happy to let you take a look at the bug since you expressed some interest πŸ™‚ I just figured I would check in to see how you were doing and perhaps offer my assistance. Thank you for reporting the bug and looking into it and providing your findings in the meantime though, I really appreciate it! πŸ‘πŸ»

All 9 comments

A data point: pasting in the same character sequence from the clipboard did not cause such an effect when I tried it, out of curiosity. I didn't try a Hangeul input method, though.

@jdebp Thanks for the additional comments! This problem is reproduced in the process of combining IME Hangul characters, so it is difficult to reproduce it by copying the clipboard.

If you test by typing the letters γ…Œ, γ…”, γ……, γ…‘, γ…Œ, γ…‘ in order, you can check the problem.

So at first glance, it seems like the TSFInputControl is getting its set of LayoutRequested events before the Terminal manages to update its cursor, leading to the TextBlock staying in the same place when it should have moved over to where the cursor currently is. If you then type one extra character after the first overlapping keypress, the LayoutRequested will fire again, and will update the TextBlock to the correct position of the cursor.

What's funny is that while debugging this by building it in Visual Studio and running it with the debugger, my breakpoints slow the events down enough that _sometimes_ the Terminal updates its cursor before the LayoutRequested event is received, which makes the text not overlap.

@KennethanCeyer I think the fix might be simple, depending on how difficult it is to figure out when we should be re-drawing where the TextBlock should be, instead of relying on LayoutRequested to do it. If you're willing to take a stab at it, let me know and I can answer questions if you have any! πŸ˜„

@leonMSFT
Thank you for a detailed description. Now it's just a matter of reading the contribution documentation and looking at the code!

Hi @KennethanCeyer, just checking in to see where you're at with this bug, if you haven't had too many chances to make much progress on it, I could pick up from where you left off. Otherwise if you're close to a PR disregard me! πŸ˜„ I'm just tracking this bug more closely than others because it's marked as a P1 bug.

@leonMSFT
Yes, I see it on my side, but it takes about 7 days to respond.
Since it's P1, I think I should not hold onto it and become a block
If you can fix it, please proceed immediately. I'm sorry I seemed to be in the way.

Please don’t apologize! You were definitely not a blocker, as I was working on some other bugs in the meantime anyway. I was happy to let you take a look at the bug since you expressed some interest πŸ™‚ I just figured I would check in to see how you were doing and perhaps offer my assistance. Thank you for reporting the bug and looking into it and providing your findings in the meantime though, I really appreciate it! πŸ‘πŸ»

:tada:This issue was addressed in #5135, which has now been successfully released as Windows Terminal Preview v0.11.1121.0.:tada:

Handy links:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MoshiBin picture MoshiBin  Β·  128Comments

cinnamon-msft picture cinnamon-msft  Β·  62Comments

patriksvensson picture patriksvensson  Β·  143Comments

CobusKruger picture CobusKruger  Β·  60Comments

Byloth picture Byloth  Β·  56Comments