terminal: combining characters are dropped on the screen and in the scrollback

Open
#2,523 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c

Research direction

Start with terminal_get_row and terminal_sb_line_extract in extensions/terminal/terminal.c, then follow the screen-cell path into render-row-direct. Reproduce the missing combining marks with the provided printf and seq commands, and check the result both on screen and after scrolling into history. The fix is complete when every non-zero entry in chars[] is encoded and the displayed and scrollback text preserve the combining marks; run the project’s verify checks.

Written by the indexing model from the issue text.

Description

M-x terminal drops combining characters, both on the screen and in the scrollback.

terminal_get_row and terminal_sb_line_extract (extensions/terminal/terminal.c) read only chars[0] of each VTermScreenCell and ignore chars[1..], where libvterm keeps the combining marks of the cell.

To reproduce: in M-x terminal, run printf 'e\xcc\x81\n'; seq 1 60 (e and U+0301 COMBINING ACUTE ACCENT). The line shows e instead of é, on the screen and after it scrolled into the history. Text written with combining marks (Thai, Indic scripts, decomposed Korean) loses them.

Fix: encode every entry of chars[] up to the first 0, in both functions. On the screen side, cell-data holds one uint32_t per cell, so render-row-direct would need the extra code points too (or the C side could compose them into the string it gives).

Found by the review of #2522 (a pre-existing issue, not changed there).

An agent can fix this and check it with verify.

Dominant language
Common Lisp
Stars
3.1k
Forks
261
Avg merge
1d 6h
Merged PRs (30d)
133

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lem-project/lem

All issues in lem-project/lem

Similar issues

More Desktop Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.