diff options
author | ray <ray@FreeBSD.org> | 2014-05-08 13:46:36 +0000 |
---|---|---|
committer | ray <ray@FreeBSD.org> | 2014-05-08 13:46:36 +0000 |
commit | 8fb9f18d805db5d589f6578039dd4a793956ae74 (patch) | |
tree | ac9390075358dcb52b5d3add5ef34a341ae21249 | |
parent | a333f6cfe13536ebcba8e0f85cc66d44828e40bb (diff) | |
download | FreeBSD-src-8fb9f18d805db5d589f6578039dd4a793956ae74.zip FreeBSD-src-8fb9f18d805db5d589f6578039dd4a793956ae74.tar.gz |
Fix scrollback.
Sponsored by: The FreeBSD Foundation
-rw-r--r-- | sys/dev/vt/vt_buf.c | 5 | ||||
-rw-r--r-- | sys/dev/vt/vt_core.c | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/vt/vt_buf.c b/sys/dev/vt/vt_buf.c index 0b078ec..598126f 100644 --- a/sys/dev/vt/vt_buf.c +++ b/sys/dev/vt/vt_buf.c @@ -448,8 +448,9 @@ vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, int history_size) 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); diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index aaf9bd6..4b006a2 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -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 *softc) vt_upgrade(vd); - /* Refill settings with new sizes. */ - vt_resize(vd); - #ifdef DEV_SPLASH if (vd->vd_flags & VDF_SPLASH) vtterm_splash(vd); |