terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Character Overlap during Korean IME Composition

Open KennethanCeyer opened this issue 6 years ago β€’ 12 comments

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.

KennethanCeyer avatar Mar 17 '20 18:03 KennethanCeyer

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 avatar Mar 17 '20 20:03 jdebp

@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.

KennethanCeyer avatar Mar 17 '20 20:03 KennethanCeyer

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

KennethanCeyer avatar Mar 17 '20 20:03 KennethanCeyer

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 avatar Mar 17 '20 21:03 leonMSFT

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

KennethanCeyer avatar Mar 18 '20 05:03 KennethanCeyer

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 avatar Mar 23 '20 19:03 leonMSFT

@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.

KennethanCeyer avatar Mar 24 '20 06:03 KennethanCeyer

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! πŸ‘πŸ»

leonMSFT avatar Mar 24 '20 07:03 leonMSFT

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

Handy links:

ghost avatar Apr 22 '20 17:04 ghost

I see this same problem in version 1.11.2921.0 when Korean typing was made in Cygwin bash. Both windows 10 and 11 show same problem.
No issue with cmd and PowerShell. Attached the picture when problem happened (I was typing "ν•œκΈ€μ„ μ‚¬μš©ν•˜λ‹€ 보며") windows terminal cygwin korean char input overlapping .

sykwon66 avatar Nov 22 '21 12:11 sykwon66

I also found the bug reproducible in 1.11.2921.0. as mentioned by @sykwon66

image

KennethanCeyer avatar Nov 24 '21 09:11 KennethanCeyer

Seems fixed in 1.12.10982.0. However there is actually very short time being overlapped still remained.

Previous: chars overlapped and stayed there. Now: momentarilly overlapped and splits.. Fixed but annoying to see.

sykwon66 avatar May 09 '22 02:05 sykwon66