[Bug]: emojis rendered inside tmux cause first characters of next line to start at end of current line

Đang mở
#3,395 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
go
Lĩnh vực
cli, desktop

Hướng nghiên cứu

Start by reproducing the emoji-width mismatch on Windows with tmux and the pi TUI, using the !printf example in the issue. Inspect WaveTerm's layout and width engine to find where the crown emoji is treated as one column. Done means text no longer overlaps or wraps incorrectly in tmux while preserving correct rendering outside tmux.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug triage
Current Behavior

Experiment running a temporary tmux server with debug logging returned:
utf8proc_wcwidth(1F451) returned 2

This is a classic multiplexer desync bug:

  1. Tmux thinks 👑 is 2 columns wide. (Correct)
  2. Pi TUI thinks 👑 is 2 columns wide. (Correct)
  3. WaveTerm's layout/width engine thinks 👑 is 1 column wide, but its font renders the glyph across 2 columns
    anyway. (Incorrect)
Why this causes chaos:
  • Directly outside tmux: There is no multiplexer virtual grid to sync. Node.js outputs sequential bytes,
    WaveTerm places them next to each other, and you only see a minor, imperceptible 1-column layout shift (like a
    box border being slightly short). No overlap, looks fine.
  • Inside tmux: Tmux maintains a strict virtual grid buffer and optimizes redraws. Because WaveTerm's width
    engine and tmux's width engine disagree, tmux's optimized cursor updates place characters directly on top of
    the second half of the emoji glyph, causing overlapping text and chaotic wrapped lines!

────────────────────────────────────────────────────────────────────────────────

How to Fix (WaveTerm Settings on your Host):

Open WaveTerm's settings tab (Cmd + , or Ctrl + , or click the gear icon):

  1. Unicode Version: Set to 11 or higher (optimally 15).
  2. East Asian Ambiguous: Toggle the setting to treat ambiguous-width characters as double-width (2 columns).
  3. Font: Ensure you're using a strictly monospaced font with correct emoji width support (e.g., JetBrains Mono,
    Fira Code, Hack, or SF Mono).
Expected Behavior

print the following using !printf to the pi TUI while in tmux:

  1. Tmux thinks 👑 is 2 columns wide. (Correct)
  2. Pi TUI thinks 👑 is 2 columns wide. (Correct)
  3. WaveTerm's layout/width engine thinks 👑 is 1 column wide, but its font renders the glyph across 2 columns
    anyway. (Incorrect)

It will render as:

print the following using !printf to the pi TUI while in tmux:

 1. Tmux thinks 👑 is 2 columns wide. (Correct)
2. Pi TUI thinks 👑 is 2 columns wide. (Correct)                                                                                                              3
. WaveTerm's layout/width engine thinks 👑 is 1 column wide, but its font renders the glyph across 2 columns
    anyway. (Incorrect)
Steps To Reproduce

print the following using !printf to the pi TUI while in tmux:

  1. Tmux thinks 👑 is 2 columns wide. (Correct)
  2. Pi TUI thinks 👑 is 2 columns wide. (Correct)
  3. WaveTerm's layout/width engine thinks 👑 is 1 column wide, but its font renders the glyph across 2 columns
    anyway. (Incorrect)
Wave Version

v0.14.5

Platform

Windows

OS Version/Distribution

Win 11

Architecture

x64

Anything else?

I am ssh'd from Windows Powershell terminal widget into a VPS running Ubuntu. Then run tmux, then run pi coding agent within tmux.
But I think you can repo without pi

Ngôn ngữ chính
Go
Star
22.3k
Fork
1.1k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của wavetermdev/waveterm

Tất cả issue của wavetermdev/waveterm

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.