Skip to content

Terminal: back color erase, and reset the pending wrap on cursor moves - #2900

Open
insjang wants to merge 2 commits into
eclipse-platform:masterfrom
insjang:erase-background
Open

Terminal: back color erase, and reset the pending wrap on cursor moves#2900
insjang wants to merge 2 commits into
eclipse-platform:masterfrom
insjang:erase-background

Conversation

@insjang

@insjang insjang commented Sep 3, 2026

Copy link
Copy Markdown

Two places where the emulator departed from what programs written for xterm expect.

Back color erase. Erasing wrote cells with no style, so they took the terminal's own background. Every colour terminal (xterm's "bce") erases in the background currently set, and programs rely on it: a run of a line is coloured by setting a background and erasing to the end of it, which is how a status line, a selection highlight or a table cell gets painted wider than its text. Without it such a run kept the terminal colour from its last character on. EL, ED and ECH now erase in the current background, and so do the cells that ICH opens and DCH uncovers, as in xterm; only the background carries over, not bold or underline.

Pending wrap. With deferred wrapping (DECAWM as xterm does it) a character written to the last column leaves the cursor there with a wrap pending. DEC STD 070 lists what clears that state: CR, LF, IND, RI, NEL, the cursor movement sequences, and the erase, insert and delete sequences. The emulator cleared it only on a column move, so a line feed or a cursor-down after a full row still wrapped the next character a row further down and marked an unrelated row as wrapped - which showed up as unrelated rows joined when copying from a full screen program.

Tests cover the backgrounds of each erase and of ICH/DCH, and the reset of the pending wrap by LF, cursor line moves and ECH.

…on any cursor move

Two places where the emulator departed from what programs written for
xterm expect.

Back color erase. Erasing wrote cells with no style, so they took the
terminal's own background. Every colour terminal (xterm's "bce")
erases in the background currently set, and programs rely on it: a run
of a line is coloured by setting a background and erasing to the end of
it, which is how a status line, a selection highlight or a table cell
gets painted wider than its text. Without it such a run kept the
terminal colour from its last character on. EL, ED and ECH now erase in
the current background, and so do the cells that ICH opens and DCH
uncovers, as in xterm; only the background carries over, not bold or
underline.

Pending wrap. With deferred wrapping (DECAWM as xterm does it) a
character written to the last column leaves the cursor there with a
wrap pending. DEC STD 070 lists what clears that state: CR, LF, IND,
RI, NEL, the cursor movement sequences, and the erase, insert and
delete sequences. The emulator cleared it only on a column move, so a
line feed or a cursor-down after a full row still wrapped the next
character a row further down and marked an unrelated row as wrapped -
which showed up as unrelated rows joined when copying from a full
screen program.

Tests cover the backgrounds of each erase and of ICH/DCH, and the reset
of the pending wrap by LF, cursor line moves and ECH.
@insjang insjang changed the title Terminal: erase in the current background, and forget a pending wrap … Terminal: back color erase, and reset the pending wrap on cursor moves Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant