svn commit: r265681 - head/sys/dev/vt

Aleksandr Rybalko ray at FreeBSD.org
Thu May 8 13:46:37 UTC 2014


Author: ray
Date: Thu May  8 13:46:36 2014
New Revision: 265681
URL: http://svnweb.freebsd.org/changeset/base/265681

Log:
  Fix scrollback.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/vt/vt_buf.c
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/vt_buf.c
==============================================================================
--- head/sys/dev/vt/vt_buf.c	Thu May  8 13:38:29 2014	(r265680)
+++ head/sys/dev/vt/vt_buf.c	Thu May  8 13:46:36 2014	(r265681)
@@ -448,8 +448,9 @@ vtbuf_grow(struct vt_buf *vb, const term
 
 	history_size = MAX(history_size, p->tp_row);
 
-	if (history_size > vb->vb_history_size || p->tp_col >
-	    vb->vb_scr_size.tp_col) {
+	/* If new screen/history size bigger or buffer is VBF_STATIC. */
+	if ((history_size > vb->vb_history_size) || (p->tp_col >
+	    vb->vb_scr_size.tp_col) || (vb->vb_flags & VBF_STATIC)) {
 		/* Allocate new buffer. */
 		bufsize = history_size * p->tp_col * sizeof(term_char_t);
 		new = malloc(bufsize, M_VTBUF, M_WAITOK | M_ZERO);

Modified: head/sys/dev/vt/vt_core.c
==============================================================================
--- head/sys/dev/vt/vt_core.c	Thu May  8 13:38:29 2014	(r265680)
+++ head/sys/dev/vt/vt_core.c	Thu May  8 13:46:36 2014	(r265681)
@@ -2016,6 +2016,10 @@ vt_upgrade(struct vt_device *vd)
 	/* Start timer when everything ready. */
 	callout_reset(&vd->vd_timer, hz / VT_TIMERFREQ, vt_timer, vd);
 	VT_UNLOCK(vd);
+
+	/* Refill settings with new sizes. */
+	vt_resize(vd);
+
 }
 
 static void
@@ -2090,9 +2094,6 @@ vt_allocate(struct vt_driver *drv, void 
 
 	vt_upgrade(vd);
 
-	/* Refill settings with new sizes. */
-	vt_resize(vd);
-
 #ifdef DEV_SPLASH
 	if (vd->vd_flags & VDF_SPLASH)
 		vtterm_splash(vd);


More information about the svn-src-head mailing list