-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Closed
Labels
Needs-Tag-FixDoesn't match tag requirementsDoesn't match tag requirementsNeeds-TriageIt's a new issue that the core contributor team needs to triage at the next triage meetingIt's a new issue that the core contributor team needs to triage at the next triage meetingResolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.Fix is checked in, but it might be 3-4 weeks until a release.
Description
Environment
Windows build number: Version 10.0.18363.1198
Windows Terminal version (if applicable):
Steps to reproduce
- Open a cmd shell in conhost.
- Output some text from a double byte character set (e.g.
こんにちは). - Output the same text with the characters repeated (e.g.
ここんんににちちはは). - Select an instance of the text from step 2.
- Press
Ctrl+Shift+4to search for matching text and color it in green.
Expected behavior
All the instances of text from step 2 should be colored in green.
Actual behavior
The search mistakenly matches the instances of text from step 3 (where the characters are repeated).
The problem is caused by the code that extracts the search text from the screen buffer here:
terminal/src/host/selectionInput.cpp
Lines 695 to 701 in d09fdd6
| auto it = screenInfo.GetTextDataAt(COORD{ selectRect.Left, selectRect.Top }); | |
| for (SHORT i = 0; i < (selectRect.Right - selectRect.Left + 1); ++i) | |
| { | |
| str.append((*it).begin(), (*it).end()); | |
| it++; | |
| } |
It's copying one screen cell at a time from the selected range, but that means each character is copied twice with DBCS text, since there are two cells per character.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs-Tag-FixDoesn't match tag requirementsDoesn't match tag requirementsNeeds-TriageIt's a new issue that the core contributor team needs to triage at the next triage meetingIt's a new issue that the core contributor team needs to triage at the next triage meetingResolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.Fix is checked in, but it might be 3-4 weeks until a release.

