~mil/sxmo-st

c20f35ef04b8c656a76c9b88d54558355775f20e — Hiltjo Posthuma 4 years ago 34080c7
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).
2 files changed, 0 insertions(+), 11 deletions(-)

M st.c
M st.info
M st.c => st.c +0 -10
@@ 136,7 136,6 @@ typedef struct {
	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 */


@@ 1717,12 1716,6 @@ csihandle(void)
		if (csiescseq.arg[0] == 0)
			ttywrite(vtiden, strlen(vtiden), 0);
		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 'a': /* HPR -- Cursor <n> Forward */
		DEFAULT(csiescseq.arg[0], 1);


@@ 2501,8 2494,6 @@ check_control_code:
		/*
		 * control codes are not shown ever
		 */
		if (!term.esc)
			term.lastc = 0;
		return;
	} else if (term.esc & ESC_START) {
		if (term.esc & ESC_CSI) {


@@ 2552,7 2543,6 @@ check_control_code:
	}

	tsetchar(u, &term.c.attr, term.c.x, term.c.y);
	term.lastc = u;

	if (width == 2) {
		gp->mode |= ATTR_WIDE;

M st.info => st.info +0 -1
@@ 184,7 184,6 @@ st-mono| simpleterm monocolor,
# XTerm extensions
	rmxx=\E[29m,
	smxx=\E[9m,
	rep=%p1%c\E[%p2%{1}%-%db,
# tmux extensions, see TERMINFO EXTENSIONS in tmux(1)
	Tc,
	Ms=\E]52;%p1%s;%p2%s\007,