Implement REP CSI

Bug #1805050 reported by Andreas Stöckel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvterm
Fix Released
Undecided
Unassigned

Bug Description

vterm does not implement the REP CSI defined in ECMA-48 section 8.3.103. This CSI is heavily used by ncurses if "TERM=xterm" to draw forms. The REP CSI repeats the last character n times until the end of the line.

Examples:

echo -e "a\e[bb"
aab

echo -e "a\e[0bb"
aab

echo -e "a\e[2bb"
aaab

echo -e "a\e[9000bb"
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [...]
b

See the attached image for the "demo_form" ncurses example application without REP.

(Note: I've already fixed this bug, but need the bug number to name the test case correctly.)

Revision history for this message
Andreas Stöckel (andreas-stoeckel) wrote :
description: updated
description: updated
Revision history for this message
Andreas Stöckel (andreas-stoeckel) wrote :

I've implemented the REP CSI in the following patch:

[PATCH] Implement REP CSI (ECMA-48 §8.3.103)
https://github.com/astoeckel/libvterm/commit/7e1aad25b4d26d54fb8d135f6c2fee4634a20d3c.patch

I'm not sure if I've handled line-wrapping with two-column characters correctly, but other than that it should be ok, I think.

See attached image for the ncurses test application demo_form with the patch applied.

description: updated
description: updated
Revision history for this message
Paul "LeoNerd" Evans (leonerd) wrote :

LGTM. Nice coverage of test cases too including some full-width Unicode.

I'll merge this as is, but then I'll rename the test case file. For actually-added features it's best to name those something relating to the feature itself so they're easier to find. The "LP" series of bug numbered-files is largely for obscure cornercases or unusual situations that come up in actual bug reports.

Looking at the test numbers currently I may have to do a bit of renumbering first though.

Revision history for this message
Paul "LeoNerd" Evans (leonerd) wrote :

Renumbered as of -r725

Changed in libvterm:
status: New → Fix Committed
Revision history for this message
Paul "LeoNerd" Evans (leonerd) wrote :
Changed in libvterm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.