support REP (repeat) escape sequence
commite8392b282c2eaa28725241a9612804fb55113da4
authorAvi Halachmi (:avih) <avihpit@yahoo.com>
Thu, 14 May 2020 15:18:07 +0000 (14 18:18 +0300)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sat, 16 May 2020 12:08:10 +0000 (16 14:08 +0200)
treea19918f19c26bae56e589fa3adb3cd7a3e9955c5
parentf8afebdfa0cc9a57b22c39c47e9b585f69453eb7
support REP (repeat) escape sequence

The sequence \e[Nb prints the last printed char N (more) times if it's
printable, and it's ignored after newline or other control chars.

This is Ecma-048/ANSI-X3.6 sequence and not DEC VT. It's supported by
xterm, and ncurses uses it when possible, e.g. when TERM is xterm* (and
with this commit also st*).

xterm supports only codepoints<=255, possibly due to internal limits.
We support any value/codepoint which was placed in a cell.

To test:
- tput rep 65 4 -> prints 'AAAA'
- printf "\342\225\246\033[4b" -> prints U+2566 1+4 times.
st.c
st.info