diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2020-05-16 18:06:42 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2020-05-16 21:06:13 +0200 |
commit | 475a0a36cb4fda1da30f014da65988e99b222876 (patch) | |
tree | 4e39ee0b9f245f4ef16d8b1b0064900d8a2313b2 | |
parent | e8392b282c2eaa28725241a9612804fb55113da4 (diff) | |
download | st-patched-475a0a36cb4fda1da30f014da65988e99b222876.tar.bz2 st-patched-475a0a36cb4fda1da30f014da65988e99b222876.tar.xz st-patched-475a0a36cb4fda1da30f014da65988e99b222876.zip |
Revert "support REP (repeat) escape sequence"
This reverts commit e8392b282c2eaa28725241a9612804fb55113da4.
There is currently a bug in older ncurses versions (like on OpenBSD) where a
fix for a bug with REP is not backported yet. Most likely in tty/tty_update.c:
Noticed while using lynx (which uses ncurses/curses).
To reproduce using lynx: echo "Z0000000" | lynx -stdin
or using the program:
int
main(void)
{
WINDOW *win;
win = initscr();
printw("Z0000000");
refresh();
sleep(5);
return 0;
}
This prints "ZZZZZZZ" (incorrectly).
-rw-r--r-- | st.c | 10 | ||||
-rw-r--r-- | st.info | 1 |
2 files changed, 0 insertions, 11 deletions
@@ -129,7 +129,6 @@ typedef struct { | |||
129 | int charset; /* current charset */ | 129 | int charset; /* current charset */ |
130 | int icharset; /* selected charset for sequence */ | 130 | int icharset; /* selected charset for sequence */ |
131 | int *tabs; | 131 | int *tabs; |
132 | Rune lastc; /* last printed char outside of sequence, 0 if control */ | ||
133 | } Term; | 132 | } Term; |
134 | 133 | ||
135 | /* CSI Escape sequence structs */ | 134 | /* CSI Escape sequence structs */ |
@@ -1649,12 +1648,6 @@ csihandle(void) | |||
1649 | if (csiescseq.arg[0] == 0) | 1648 | if (csiescseq.arg[0] == 0) |
1650 | ttywrite(vtiden, strlen(vtiden), 0); | 1649 | ttywrite(vtiden, strlen(vtiden), 0); |
1651 | break; | 1650 | break; |
1652 | case 'b': /* REP -- if last char is printable print it <n> more times */ | ||
1653 | DEFAULT(csiescseq.arg[0], 1); | ||
1654 | if (term.lastc) | ||
1655 | while (csiescseq.arg[0]-- > 0) | ||
1656 | tputc(term.lastc); | ||
1657 | break; | ||
1658 | case 'C': /* CUF -- Cursor <n> Forward */ | 1651 | case 'C': /* CUF -- Cursor <n> Forward */ |
1659 | case 'a': /* HPR -- Cursor <n> Forward */ | 1652 | case 'a': /* HPR -- Cursor <n> Forward */ |
1660 | DEFAULT(csiescseq.arg[0], 1); | 1653 | DEFAULT(csiescseq.arg[0], 1); |
@@ -2380,8 +2373,6 @@ check_control_code: | |||
2380 | /* | 2373 | /* |
2381 | * control codes are not shown ever | 2374 | * control codes are not shown ever |
2382 | */ | 2375 | */ |
2383 | if (!term.esc) | ||
2384 | term.lastc = 0; | ||
2385 | return; | 2376 | return; |
2386 | } else if (term.esc & ESC_START) { | 2377 | } else if (term.esc & ESC_START) { |
2387 | if (term.esc & ESC_CSI) { | 2378 | if (term.esc & ESC_CSI) { |
@@ -2431,7 +2422,6 @@ check_control_code: | |||
2431 | } | 2422 | } |
2432 | 2423 | ||
2433 | tsetchar(u, &term.c.attr, term.c.x, term.c.y); | 2424 | tsetchar(u, &term.c.attr, term.c.x, term.c.y); |
2434 | term.lastc = u; | ||
2435 | 2425 | ||
2436 | if (width == 2) { | 2426 | if (width == 2) { |
2437 | gp->mode |= ATTR_WIDE; | 2427 | gp->mode |= ATTR_WIDE; |
@@ -184,7 +184,6 @@ st-mono| simpleterm monocolor, | |||
184 | # XTerm extensions | 184 | # XTerm extensions |
185 | rmxx=\E[29m, | 185 | rmxx=\E[29m, |
186 | smxx=\E[9m, | 186 | smxx=\E[9m, |
187 | rep=%p1%c\E[%p2%{1}%-%db, | ||
188 | # tmux extensions, see TERMINFO EXTENSIONS in tmux(1) | 187 | # tmux extensions, see TERMINFO EXTENSIONS in tmux(1) |
189 | Tc, | 188 | Tc, |
190 | Ms=\E]52;%p1%s;%p2%s\007, | 189 | Ms=\E]52;%p1%s;%p2%s\007, |