From 035cb01fbbe932e0165a764ecab69cd6492d5fbc Mon Sep 17 00:00:00 2001 From: dumbbell Date: Sat, 1 Nov 2014 17:05:15 +0000 Subject: vt(4): Adjust the cursor position after changing the window size A new terminal_set_cursor() is added: it wraps the existing teken_set_cursor() function. In vtbuf_grow(), the cursor position is adjusted at the end of the function. In vt_change_font(), we call terminal_set_cursor() just after terminal_set_winsize_blank(), while the terminal is mute. This fixes a bug where, after loading a kernel video driver which increases the terminal window size, the cursor remains at its old position, in other words, in the middle of the display content. PR: 194421 MFC after: 1 week --- sys/kern/subr_terminal.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/kern/subr_terminal.c') diff --git a/sys/kern/subr_terminal.c b/sys/kern/subr_terminal.c index 69345df..76c6cfb 100644 --- a/sys/kern/subr_terminal.c +++ b/sys/kern/subr_terminal.c @@ -190,6 +190,13 @@ terminal_maketty(struct terminal *tm, const char *fmt, ...) } void +terminal_set_cursor(struct terminal *tm, const term_pos_t *pos) +{ + + teken_set_cursor(&tm->tm_emulator, pos); +} + +void terminal_set_winsize_blank(struct terminal *tm, const struct winsize *size, int blank, const term_attr_t *attr) { -- cgit v1.1