Date: Fri, 18 Aug 2017 12:45:00 +0000 (UTC) From: Bruce Evans <bde@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322655 - head/sys/dev/syscons Message-ID: <201708181245.v7ICj0FI022494@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bde Date: Fri Aug 18 12:45:00 2017 New Revision: 322655 URL: https://svnweb.freebsd.org/changeset/base/322655 Log: Fix vt100 escape sequence for showing and hiding the cursor in syscons. It should toggle between 2 states, but it used a cut-down version of support for a related 3-state syscons escape sequence and inherited bugs from that. The usual misbehaviour was that hiding and showing the cursor reset it to a global default. Support for the 3-state sequence remains broken by aliasing to the 2-state sequence. This works better but incompatibly for the 2 cases that it supports. Modified: head/sys/dev/syscons/scterm-teken.c Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Fri Aug 18 11:33:10 2017 (r322654) +++ head/sys/dev/syscons/scterm-teken.c Fri Aug 18 12:45:00 2017 (r322655) @@ -674,6 +674,7 @@ static void scteken_param(void *arg, int cmd, unsigned int value) { scr_stat *scp = arg; + int flags; switch (cmd) { case TP_SETBORDER: @@ -682,13 +683,11 @@ scteken_param(void *arg, int cmd, unsigned int value) sc_set_border(scp, scp->border); break; case TP_SHOWCURSOR: - if (value) { - sc_change_cursor_shape(scp, - CONS_RESET_CURSOR|CONS_LOCAL_CURSOR, -1, -1); - } else { - sc_change_cursor_shape(scp, - CONS_HIDDEN_CURSOR|CONS_LOCAL_CURSOR, -1, -1); - } + if (value != 0) + flags = scp->curr_curs_attr.flags & ~CONS_HIDDEN_CURSOR; + else + flags = scp->curr_curs_attr.flags | CONS_HIDDEN_CURSOR; + sc_change_cursor_shape(scp, flags | CONS_LOCAL_CURSOR, -1, -1); break; case TP_SWITCHVT: sc_switch_scr(scp->sc, value);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708181245.v7ICj0FI022494>