Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TUI layout misalignment when encountering combining diacritical marks (grapheme clusters) #6603

Open
JustForFun88 opened this issue Jan 25, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@JustForFun88
Copy link

JustForFun88 commented Jan 25, 2025

What Operating System(s) are you seeing this problem on?

Windows

Which Wayland compositor or X11 Window manager(s) are you using?

No response

WezTerm version

wezterm 20240203-110809-5046fc22

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

When using certain TUI applications (for example, Yazi) in WezTerm on Windows, the interface layout breaks if file or directory names contain combining diacritical marks (e.g., U+0301, U+0306, etc.). This results in:

  • Panels or UI sections shifting to the left or breaking where these characters appear.
  • Residual artifacts left behind from previous frames.
  • Overlapping panels, causing the interface to become distorted.

To Reproduce

Observations

  1. Reproducible in WezTerm version: 20240203-110809-5046fc22 (Windows 11).
  2. Not reproducible in Windows Terminal Preview (version 1.22.3232.0).
  3. Reproducible in Windows Terminal (Stable) version 1.21.3231.0, but apparently fixed in the Preview release — see Implement grapheme clusters #16916.

Steps to Reproduce

  1. Create a directory (or file) with a name containing combining characters. Examples:
    • examplé (where é = U+0065 + U+0301)
    • Голицынский Ю.Б. (where й = U+0438 + U+0306)
    • stacked̀̂ (where à̂ = U+0061 + U+0300 + U+0302)
  2. Open WezTerm and start Yazi.
  3. Navigate to or through the directory containing these names. As soon as the directory name with combining characters is displayed, the TUI layout becomes misaligned. Panels or textual elements shift incorrectly whenever they encounter characters formed by multiple code points. Horizontal and vertical boundaries are broken, with leftover rendering artifacts. The interface appears as if the width of these combining marks is not calculated correctly, causing layout distortion.

Configuration

"no config"

Expected Behavior

The TUI layout should account for the full grapheme cluster width and render the interface properly without shifting, breaking, or leaving behind artifacts.

Logs

No response

Anything else?

System Info

  • WezTerm version: 20240203-110809-5046fc22 (Windows)
  • Windows version: Windows 11 Pro, Version 24H2, OS Build 26100.2894
  • Other terminals:
    • Windows Terminal Preview 1.22.3232.0: No issues
    • Windows Terminal (Stable) 1.21.3231.0: Issue present

Additional Context

This issue appears similar to what was reported and addressed in Windows Terminal via Implement grapheme clusters #16916. It seems WezTerm might be rendering or calculating grapheme cluster widths incorrectly, leading to improper cursor placement and layout shifts. Disabling plugins or changing fonts in Yazi or WezTerm did not resolve the issue, suggesting it is likely tied to how WezTerm handles grapheme clusters internally.

@JustForFun88 JustForFun88 added the bug Something isn't working label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant