Module Name:    src
Committed By:   christos
Date:           Fri Apr 12 17:30:49 UTC 2019

Modified Files:
        src/lib/libedit: terminal.c

Log Message:
PR/52359: Benjamin Lorenz: When resizing because of a signal save and restore
the cursor position, since it does not change.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/lib/libedit/terminal.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libedit/terminal.c
diff -u src/lib/libedit/terminal.c:1.35 src/lib/libedit/terminal.c:1.36
--- src/lib/libedit/terminal.c:1.35	Fri Feb 15 18:20:35 2019
+++ src/lib/libedit/terminal.c	Fri Apr 12 13:30:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: terminal.c,v 1.35 2019/02/15 23:20:35 christos Exp $	*/
+/*	$NetBSD: terminal.c,v 1.36 2019/04/12 17:30:49 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.35 2019/02/15 23:20:35 christos Exp $");
+__RCSID("$NetBSD: terminal.c,v 1.36 2019/04/12 17:30:49 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -966,9 +966,10 @@ terminal_get_size(EditLine *el, int *lin
 libedit_private int
 terminal_change_size(EditLine *el, int lins, int cols)
 {
+	coord_t cur = el->el_cursor;
 	/*
-         * Just in case
-         */
+	 * Just in case
+	 */
 	Val(T_co) = (cols < 2) ? 80 : cols;
 	Val(T_li) = (lins < 1) ? 24 : lins;
 
@@ -976,6 +977,7 @@ terminal_change_size(EditLine *el, int l
 	if (terminal_rebuffer_display(el) == -1)
 		return -1;
 	re_clear_display(el);
+	el->el_cursor = cur;
 	return 0;
 }
 

Reply via email to