PR/54329: Raphael Ross: According to https://www.gnu.org/software/termutils/\
manual/termcap-1.3/html_chapter/termcap_4.html#SEC23 the cursor move multiple escapes have undefined results when moving out of the screen. Stop using DO to move down multiple lines and use a loop of newlines instead.
This commit is contained in:
parent
168837a76f
commit
0d31660187
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: terminal.c,v 1.36 2019/04/12 17:30:49 christos Exp $ */
|
||||
/* $NetBSD: terminal.c,v 1.37 2019/06/29 21:35:09 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -37,7 +37,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: terminal.c,v 1.36 2019/04/12 17:30:49 christos Exp $");
|
||||
__RCSID("$NetBSD: terminal.c,v 1.37 2019/06/29 21:35:09 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
|
@ -509,15 +509,10 @@ terminal_move_to_line(EditLine *el, int where)
|
|||
return;
|
||||
}
|
||||
if ((del = where - el->el_cursor.v) > 0) {
|
||||
if ((del > 1) && GoodStr(T_DO)) {
|
||||
terminal_tputs(el, tgoto(Str(T_DO), del, del), del);
|
||||
del = 0;
|
||||
} else {
|
||||
for (; del > 0; del--)
|
||||
terminal__putc(el, '\n');
|
||||
/* because the \n will become \r\n */
|
||||
el->el_cursor.h = 0;
|
||||
}
|
||||
for (; del > 0; del--)
|
||||
terminal__putc(el, '\n');
|
||||
/* because the \n will become \r\n */
|
||||
el->el_cursor.h = 0;
|
||||
} else { /* del < 0 */
|
||||
if (GoodStr(T_UP) && (-del > 1 || !GoodStr(T_up)))
|
||||
terminal_tputs(el, tgoto(Str(T_UP), -del, -del), -del);
|
||||
|
|
Loading…
Reference in New Issue