Conhost fills two cells for single-width glyph (unicode \u23CE ⏎ character before each prompt in fish in WSL) #217

Closed
opened 2026-01-30 21:46:02 +00:00 by claunia · 3 comments
Owner

Originally created by @Maximus5 on GitHub (Apr 12, 2018).

  • Windows build number: Chinese build 10.0.16299.15
  • Problem: unicode \u23CE ⏎ character preceding every prompt in fish in WSL
  • Reason: the single-width glyph occupies two cells but only in CJK Windows builds
  • Originally reported here: https://github.com/Maximus5/ConEmu/issues/1402
max@MAXP:~$ fish
Welcome to fish, the friendly interactive shell
⏎
max@MAXP ~>
⏎
max@MAXP ~>

Screenshot

Conhost internal breaking changes

The problem is that on CJK Windows versions conhost still behaves differently than on European versions.
Especially in that case, when fish outputs the ⏎ (U+23CE) conhost advances the cursor by two cells on CJK Windows 10 (I'm trying Chinese build 10.0.16299.15), but on European version the cursor is advanced by only one cell as expected!

Conhost fills two cells with single-width glyph. Yeah, it sets the COMMON_LVB_LEADING_BYTE and COMMON_LVB_TRAILING_BYTE flags in these two cells, but terminal app (fish) expects that it output only one character and things are broken.

From my tests, a lot of glyphs are treated improperly as double-cell characters on CJK windows (at least all Russian and Greek letters).

Repro steps

  • Fresh installation of Chinese Windows 10.0.16299.15
  • Installed Developer Mode, Windows Subsystem for Linux and Ubuntu (from store)
  • Started Ubuntu, successfully downloaded, got to bash prompt
  • Installed latest version of fish in Ubuntu console
sudo apt-add-repository ppa:fish-shell/release-2
sudo apt-get update
sudo apt-get install fish
  • Started fish from bash prompt.
Originally created by @Maximus5 on GitHub (Apr 12, 2018). * Windows build number: **Chinese** build 10.0.16299.15 * Problem: unicode \u23CE ⏎ character preceding every prompt in fish in WSL * Reason: the single-width glyph occupies two cells but only in CJK Windows builds * Originally reported here: https://github.com/Maximus5/ConEmu/issues/1402 ``` max@MAXP:~$ fish Welcome to fish, the friendly interactive shell ⏎ max@MAXP ~> ⏎ max@MAXP ~> ``` [Screenshot](https://user-images.githubusercontent.com/1222388/38550703-e84822d0-3cbf-11e8-92ef-6e9df432b309.png) ### Conhost internal breaking changes The problem is that on CJK Windows versions conhost still behaves differently than on European versions. Especially in that case, when fish outputs the ⏎ (U+23CE) conhost advances the cursor by two cells on CJK Windows 10 (I'm trying Chinese build 10.0.16299.15), but on European version the cursor is advanced by only one cell as expected! Conhost fills two cells with single-width glyph. Yeah, it sets the COMMON_LVB_LEADING_BYTE and COMMON_LVB_TRAILING_BYTE flags in these two cells, but terminal app (fish) expects that it output only one character and things are broken. From my tests, a lot of glyphs are treated improperly as double-cell characters on CJK windows (at least all Russian and Greek letters). ### Repro steps * Fresh installation of Chinese Windows 10.0.16299.15 * Installed Developer Mode, Windows Subsystem for Linux and Ubuntu (from store) * Started Ubuntu, successfully downloaded, got to bash prompt * Installed [latest version of fish](https://launchpad.net/~fish-shell/+archive/ubuntu/release-2) in Ubuntu console ``` sudo apt-add-repository ppa:fish-shell/release-2 sudo apt-get update sudo apt-get install fish ``` * Started `fish` from bash prompt.
Author
Owner

@wtdcode commented on GitHub (Jul 24, 2018):

same problem without WSL when using cmder but behave normally when using mintty.

@wtdcode commented on GitHub (Jul 24, 2018): same problem **without WSL** when using cmder but behave normally when using mintty.
Author
Owner

@zadjii-msft commented on GitHub (Aug 22, 2022):

I'm fully betting this was fixed by other unicode width fixes over the last 4 years.

@zadjii-msft commented on GitHub (Aug 22, 2022): I'm fully betting this was fixed by other unicode width fixes over the last 4 years.
Author
Owner

@ghost commented on GitHub (Aug 26, 2022):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Aug 26, 2022): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#217