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

Panes misalign when handling combining characters in directory names #2116

Open
3 tasks done
JustForFun88 opened this issue Dec 29, 2024 · 2 comments
Open
3 tasks done
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@JustForFun88
Copy link

What system are you running Yazi on?

Windows

What terminal are you running Yazi in?

wezterm 20240203-110809-5046fc22

yazi --debug output

Yazi
    Version: 0.4.3 (2770e02 2024-12-27)
    Debug  : false
    Triple : x86_64-pc-windows-msvc (windows-x86_64)
    Rustc  : 1.83.0 (90b35a62 2024-11-26)

Ya
    Version: 0.4.3 (2770e02 2024-12-27)

Emulator
    Brand.from_env      : Some(WezTerm)
    Emulator.detect     : Emulator { kind: Left(WezTerm), light: false, cell_size: None }
    Emulator.detect_full: Ok(Emulator { kind: Right(Unknown { kgp: false, sixel: false }), light: false, cell_size: None })

Adapter
    Adapter.matches: Iip

Desktop
    XDG_SESSION_TYPE           : None
    WAYLAND_DISPLAY            : None
    DISPLAY                    : None
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

NVIM
    NVIM          : false
    Neovim version: program not found

Variables
    SHELL           : None
    EDITOR          : None
    VISUAL          : None
    YAZI_FILE_ONE   : Some("C:\\Program Files\\Git\\usr\\bin\\file.exe")
    YAZI_CONFIG_HOME: None
    YAZI_ZOXIDE_OPTS: None
    FZF_DEFAULT_OPTS: None

Text Opener
    default     : Some(Opener { run: "hx %*", block: true, orphan: false, desc: "helix", for_: None, spread: true })
    block-create: Some(Opener { run: "hx %*", block: true, orphan: false, desc: "helix", for_: None, spread: true })
    block-rename: Some(Opener { run: "hx %*", block: true, orphan: false, desc: "helix", for_: None, spread: true })

Multiplexers
    TMUX               : 0
    tmux version       : program not found
    tmux build flags   : enable-sixel=Unknown
    ZELLIJ_SESSION_NAME: None
    Zellij version     : program not found

Dependencies
    file          : 5.45
    ueberzugpp    : program not found
    ffmpeg/ffprobe: 7.1 / 7.1
    pdftoppm      : 24.08.0
    magick        : 7.1.1-43
    fzf           : 0.57.0
    fd/fdfind     : 10.2.0 / program not found
    rg            : 14.1.1
    chafa         : program not found
    zoxide        : 0.9.6
    7z/7zz        : 23.01 / program not found
    jq            : 1.7.1

Clipboard
    wl-copy/paste: program not found / program not found
    xclip        : program not found
    xsel         : program not found

Describe the bug

The bug occurs when a directory name contains combining characters (e.g., COMBINING BREVE (U+0306), COMBINING ACUTE ACCENT (U+0301) and so on). This causes the panes in yazi to render incorrectly after navigating to or past such directories.

The bug manifests as follows:

  • Panes misalign vertically and shift to the left, breaking the expected visual boundaries of the interface.
  • The first pane (showing the previous directory) overflows its left boundary, leaving residual artifacts outside its designated area.
  • Panes overlap each other, leading to a distorted view where their layout breaks down.

The effect resembles "refraction" when crossing boundaries, with panels "breaking" at the boundary between two mediums. This results in a distorted layout, overlapping panes, and persistent rendering artifacts.

This behavior is observed with directory names containing Unicode combining characters, such as:

  • Голицынский (й = U+0438 + U+0306)
  • examplé (é = U+0065 + U+0301)
  • resumé (é = U+0065 + U+0301)

Minimal reproducer

  1. Create a directory with a name that includes combining characters. Examples:
    • Голицынский Ю.Б. (й = U+0438 + U+0306)
    • examplé (é = U+0065 + U+0301)
  2. Navigate to the parent directory of the created directory. Open yazi in the parent directory
  3. Navigate into and out of the problematic directory or pass the folder that contains problematic directory. Observe how the panes render.

For example, here I created a directory with the name of the book: stacked̀̂ (à̂ = U+0061 + U+0300 + U+0302, COMBINING GRAVE ACCENT + COMBINING CIRCUMFLEX ACCENT). But it is not necessary to have exactly two symbols. Let's say Голицынский Ю.Б. is also enough.

Screen.Recording.2024-12-29.143637.mp4

Anything else?

No response

Checklist

  • I tried the latest nightly build, and the issue is still reproducible
  • I updated the debug information (yazi --debug) input box to the nightly that I tried
  • I can reproduce it after disabling all custom configs/plugins (mv ~/.config/yazi ~/.config/yazi-backup)
@JustForFun88 JustForFun88 added the bug Something isn't working label Dec 29, 2024
@sxyazi
Copy link
Owner

sxyazi commented Dec 29, 2024

My knowledge of Unicode is quite limited, and I've never used these characters myself, so it's hard to say how to fix this.

I'll add the "help wanted" tag and count on the community to help with this.

@sxyazi sxyazi added the help wanted Extra attention is needed label Dec 29, 2024
@sxyazi
Copy link
Owner

sxyazi commented Dec 29, 2024

Note that Yazi doesn't handle text rendering itself, but relies on the underlying TUI framework ratatui. So this issue may need to be fixed upstream rather than in Yazi.

It might be related to or a duplicate of #1714

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants