st.c | 10 ++++++++++ st.info | 2 ++ diff --git a/st.c b/st.c index 0d35613e04222564ab5fee489df6e1812b0a027f..54af09826c7389b4eac288273fb1aa121f471d76 100644 --- a/st.c +++ b/st.c @@ -129,6 +129,7 @@ char trantbl[4]; /* charset table translation */ int charset; /* current charset */ int icharset; /* selected charset for sequence */ int *tabs; + Rune lastc; /* last printed char outside of sequence, 0 if control */ } Term; /* CSI Escape sequence structs */ @@ -1648,6 +1649,12 @@ case 'c': /* DA -- Device Attributes */ if (csiescseq.arg[0] == 0) ttywrite(vtiden, strlen(vtiden), 0); break; + case 'b': /* REP -- if last char is printable print it more times */ + DEFAULT(csiescseq.arg[0], 1); + if (term.lastc) + while (csiescseq.arg[0]-- > 0) + tputc(term.lastc); + break; case 'C': /* CUF -- Cursor Forward */ case 'a': /* HPR -- Cursor Forward */ DEFAULT(csiescseq.arg[0], 1); @@ -2373,6 +2380,8 @@ tcontrolcode(u); /* * control codes are not shown ever */ + if (!term.esc) + term.lastc = 0; return; } else if (term.esc & ESC_START) { if (term.esc & ESC_CSI) { @@ -2422,6 +2431,7 @@ gp = &term.line[term.c.y][term.c.x]; } tsetchar(u, &term.c.attr, term.c.x, term.c.y); + term.lastc = u; if (width == 2) { gp->mode |= ATTR_WIDE; diff --git a/st.info b/st.info index d0694e229c84037a3b01c7518fe2eeb4568c7904..8201ad62c20f4431baa318ddaad45510a185f41a 100644 --- a/st.info +++ b/st.info @@ -184,6 +184,8 @@ vpa=\E[%i%p1%dd, # XTerm extensions rmxx=\E[29m, 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) Tc, Ms=\E]52;%p1%s;%p2%s\007,