AnalogTerm2: Add a special ATC sequence to control if CIVIS allowed.
authorMatthew Mondor <mmondor@pulsar-zone.net>
Tue, 9 May 2023 04:25:12 +0000 (04:25 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Tue, 9 May 2023 04:25:12 +0000 (04:25 +0000)
mmsoftware/analogterm2/src/main.c
mmsoftware/analogterm2/src/state.c

index fce5ab5..aa5795f 100644 (file)
@@ -255,6 +255,7 @@ usage(void)
            "      [?658467;65541h and [?658467;65542h.\n"
            " -d - Log emulator debug messages to stderr.\n"
            " -D - Toggle if the cursor can be disabled/invisible or not.\n"
+           "      This can be configured using [?658467;65549h and 65550h.\n"
            " -S - Wait in a sleeping loop until the user closes the window\n"
            "      before exiting.  This is useful to view the output of\n"
            "      custom commands along with -e.\n"
index cb59bcb..41f38bf 100644 (file)
@@ -1202,6 +1202,17 @@ state_emul_printc(state_t *st, uint8_t c)
                                                            false;
                                                        st->text_updateall =
                                                            true;
+                                               } else if (p == 65549) {
+                                                       cfg_cursordisable =
+                                                           true;
+                                               } else if (p == 65550) {
+                                                       cfg_cursordisable =
+                                                           false;
+                                                       st->cursor_disabled =
+                                                           false;
+                                                       draw_blink_reset();
+                                                       state_update_cursor(
+                                                           st);
                                                }
                                        } else if ((state->curparam == 2 &&
                                                    state->csiparam[1] ==
@@ -1413,6 +1424,7 @@ endh:
                                case 25: /* Hide cursor (DECTCEM, civis) */
                                        if (cfg_cursordisable)
                                                st->cursor_disabled = true;
+                                       state_update_cursor(st);
                                        break;
                                case 2004: /* Bracketed paste mode */
                                        st->quotedpaste = false;