DBCS characters rendered incorrectly when scrolling horizontally in conhost #11565

Open
opened 2026-01-31 02:51:19 +00:00 by claunia · 0 comments
Owner

Originally created by @j4james on GitHub (Nov 24, 2020).

Environment

Windows build number: Version 10.0.18363.1198
Windows Terminal version (if applicable): Commit 1fbcf34ba8

Steps to reproduce

  1. Build OpenConsole.
  2. Run Host.EXE with a bash shell.
  3. Open the console properties and turn off Wrap text output on resize.
  4. Also make sure the Screen Buffer Size is wider than the Window Size so there's a horizontal scrollbar.
  5. Enter some DBCS characters at the prompt (the example below uses 子小尒尢).
  6. Wiggle the horizontal scroll bar backwards and forwards a few times, so those characters are being scrolled in and out of view.

I should add that I just picked these characters at random from charmap, so my apologies if they mean anything offensive.

Expected behavior

The characters should always be rendered correctly.

image

Actual behavior

Sometimes the characters get chopped in half, or rendered in the wrong place so they're overlapping other characters.

image

I can't reproduce this in the conhost that comes with my current version of Windows, so it looks like it might be a regression. But I also checked out the initial commit of OpenConsole and it seems to have already been broken then. Is it possible my version of Windows is so old that it's prior to the first open source release?

Anyway, I think I know what the problem is - a couple of problems actually. I'll try and write up an explanation later with my proposed fix.

Originally created by @j4james on GitHub (Nov 24, 2020). # Environment Windows build number: Version 10.0.18363.1198 Windows Terminal version (if applicable): Commit 1fbcf34ba8a5edfe2d78ffcf69496f10b9cc3d25 # Steps to reproduce 1. Build _OpenConsole_. 2. Run _Host.EXE_ with a bash shell. 3. Open the console properties and turn off _Wrap text output on resize_. 4. Also make sure the _Screen Buffer Size_ is wider than the _Window Size_ so there's a horizontal scrollbar. 5. Enter some DBCS characters at the prompt (the example below uses `子小尒尢`). 6. Wiggle the horizontal scroll bar backwards and forwards a few times, so those characters are being scrolled in and out of view. I should add that I just picked these characters at random from charmap, so my apologies if they mean anything offensive. # Expected behavior The characters should always be rendered correctly. ![image](https://user-images.githubusercontent.com/4181424/100147658-946a5980-2e93-11eb-874a-78f6e3a365e2.png) # Actual behavior Sometimes the characters get chopped in half, or rendered in the wrong place so they're overlapping other characters. ![image](https://user-images.githubusercontent.com/4181424/100147691-9af8d100-2e93-11eb-94ed-d9d5870ba02f.png) I can't reproduce this in the conhost that comes with my current version of Windows, so it looks like it might be a regression. But I also checked out the initial commit of _OpenConsole_ and it seems to have already been broken then. Is it possible my version of Windows is so old that it's prior to the first open source release? Anyway, I think I know what the problem is - a couple of problems actually. I'll try and write up an explanation later with my proposed fix.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11565