mirror of
https://github.com/mintycube/st.git
synced 2024-10-22 14:05:49 +02:00
Partially add back in "support REP (repeat) escape sequence" (aa0631)
Add the functionality back in for xterm compatibility, but do not expose the capability in st.info (yet). Some notes: It was reverted because it caused some issues with ncurses in some configurations, namely when using BSD padding (--enable-bsdpad, BSD_TPUTS) in ncurses it caused issues with repeating digits. A fix has been upstreamed in ncurses since snapshot 20200523. The fix is also backported to OpenBSD -current.
This commit is contained in:
parent
e0169edec9
commit
47370640e4
10
st.c
10
st.c
@ -142,6 +142,7 @@ typedef struct {
|
|||||||
int charset; /* current charset */
|
int charset; /* current charset */
|
||||||
int icharset; /* selected charset for sequence */
|
int icharset; /* selected charset for sequence */
|
||||||
int *tabs;
|
int *tabs;
|
||||||
|
Rune lastc; /* last printed char outside of sequence, 0 if control */
|
||||||
} Term;
|
} Term;
|
||||||
|
|
||||||
/* CSI Escape sequence structs */
|
/* CSI Escape sequence structs */
|
||||||
@ -1793,6 +1794,12 @@ csihandle(void)
|
|||||||
if (csiescseq.arg[0] == 0)
|
if (csiescseq.arg[0] == 0)
|
||||||
ttywrite(vtiden, strlen(vtiden), 0);
|
ttywrite(vtiden, strlen(vtiden), 0);
|
||||||
break;
|
break;
|
||||||
|
case 'b': /* REP -- if last char is printable print it <n> more times */
|
||||||
|
DEFAULT(csiescseq.arg[0], 1);
|
||||||
|
if (term.lastc)
|
||||||
|
while (csiescseq.arg[0]-- > 0)
|
||||||
|
tputc(term.lastc);
|
||||||
|
break;
|
||||||
case 'C': /* CUF -- Cursor <n> Forward */
|
case 'C': /* CUF -- Cursor <n> Forward */
|
||||||
case 'a': /* HPR -- Cursor <n> Forward */
|
case 'a': /* HPR -- Cursor <n> Forward */
|
||||||
DEFAULT(csiescseq.arg[0], 1);
|
DEFAULT(csiescseq.arg[0], 1);
|
||||||
@ -2543,6 +2550,8 @@ check_control_code:
|
|||||||
/*
|
/*
|
||||||
* control codes are not shown ever
|
* control codes are not shown ever
|
||||||
*/
|
*/
|
||||||
|
if (!term.esc)
|
||||||
|
term.lastc = 0;
|
||||||
return;
|
return;
|
||||||
} else if (term.esc & ESC_START) {
|
} else if (term.esc & ESC_START) {
|
||||||
if (term.esc & ESC_CSI) {
|
if (term.esc & ESC_CSI) {
|
||||||
@ -2592,6 +2601,7 @@ check_control_code:
|
|||||||
}
|
}
|
||||||
|
|
||||||
tsetchar(u, &term.c.attr, term.c.x, term.c.y);
|
tsetchar(u, &term.c.attr, term.c.x, term.c.y);
|
||||||
|
term.lastc = u;
|
||||||
|
|
||||||
if (width == 2) {
|
if (width == 2) {
|
||||||
gp->mode |= ATTR_WIDE;
|
gp->mode |= ATTR_WIDE;
|
||||||
|
2
st.info
2
st.info
@ -184,6 +184,8 @@ st-mono| simpleterm monocolor,
|
|||||||
# XTerm extensions
|
# XTerm extensions
|
||||||
rmxx=\E[29m,
|
rmxx=\E[29m,
|
||||||
smxx=\E[9m,
|
smxx=\E[9m,
|
||||||
|
# disabled rep for now: causes some issues with older ncurses versions.
|
||||||
|
# rep=%p1%c\E[%p2%{1}%-%db,
|
||||||
# tmux extensions, see TERMINFO EXTENSIONS in tmux(1)
|
# tmux extensions, see TERMINFO EXTENSIONS in tmux(1)
|
||||||
Tc,
|
Tc,
|
||||||
Ms=\E]52;%p1%s;%p2%s\007,
|
Ms=\E]52;%p1%s;%p2%s\007,
|
||||||
|
Loading…
Reference in New Issue
Block a user