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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to