AnalogTerm2: Add -I to disable resetting cursor on for input.
authorMatthew Mondor <mmondor@pulsar-zone.net>
Sat, 4 Nov 2023 22:27:56 +0000 (22:27 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Sat, 4 Nov 2023 22:27:56 +0000 (22:27 +0000)
mmsoftware/analogterm2/TODO.txt
mmsoftware/analogterm2/src/config.c
mmsoftware/analogterm2/src/config.h
mmsoftware/analogterm2/src/main.c
mmsoftware/analogterm2/src/screen.c

index a868f8c..47ad429 100644 (file)
@@ -84,7 +84,7 @@
 - Character graphics before 🭨
   https://en.wikipedia.org/wiki/Box-drawing_character
 - ≣ † ☆ ツ ⌘›🍺∴ ( ͡° ͜ʖ ͡°)   ƒ   ︵  ₂   😈  θ  ƒ  ›  ʼ  ƒ ∂  ʻ  μ  ›  ∫   ◇ ♪
-  ► ə β ə ſ ρ ə ∴ ♪ 😱 † 😳 › ▛ ᵗ * ‽ ℣ Ω  ⌘   ❇ ⸮ Σ н
+  ► ə β ə ſ ρ ə ∴ ♪ 😱 † 😳 › ▛ ᵗ * ‽ ℣ Ω  ⌘   ❇ ⸮ Σ н ● ≈ ℗
 - Verify if dead key support is incomplete for ISO-8859-4 and ISO-8859-10.
   There were special characters that were unicode since the start but also
   could have punctuation.  And others that used two at a time...  It might
index 20bb64d..9093bab 100644 (file)
@@ -57,7 +57,7 @@ int   cfg_refreshspeed, cfg_cursorblinkspeedon, cfg_cursorblinkspeedoff,
        cfg_textblinkspeedon, cfg_textblinkspeedoff, cfg_cursormode,
        cfg_flashtime;
 bool   cfg_cursorblink, cfg_cursordisable, cfg_cursorbright,
-       cfg_cursorprintreset, cfg_textblink;
+       cfg_cursorinputreset, cfg_cursorprintreset, cfg_textblink;
 int    cfg_intmin, cfg_intstep, cfg_intfg, cfg_intscan, cfg_intbg;
 double cfg_intfgf, cfg_intscanf, cfg_intbgf;
 int    cfg_text_width, cfg_text_height;
@@ -94,6 +94,7 @@ cfg_setdefaults(void)
        cfg_cursorblink = CURSOR_BLINK;
        cfg_cursorbright = CURSOR_BRIGHT;
        cfg_cursordisable = CURSOR_DISABLE;
+       cfg_cursorinputreset = CURSOR_INPUTRESET;
        cfg_cursorprintreset = CURSOR_PRINTRESET;
        cfg_textblink = TEXT_BLINK;
        cfg_textblinkspeedon = TEXT_BLINK_SPEED_ON;
index ef79213..22a9348 100644 (file)
@@ -141,9 +141,10 @@ extern bool cfg_cursordisable;
  * Reset cursor timer when printing, not only for user input.
  */
 
+#define CURSOR_INPUTRESET      true
 #define CURSOR_PRINTRESET      false
 
-extern bool cfg_cursorprintreset;
+extern bool cfg_cursorinputreset, cfg_cursorprintreset;
 
 
 /*
index 4487b71..2248c2a 100644 (file)
@@ -209,8 +209,8 @@ usage(void)
        (void)printf(
            "\nUsage: %s [-1 | -2] [-8|-u] [-w <cols>] [-h <rows>] [-E <n>]\n"
            "    [-s] [-C <col>] [-c] [-W] [-b] [-r <ms>] [-R <recordfifo>]\n"
-           "    [-B <ticks>[,<ticks>]] [-j <n>] [-P] [-m <mode>] [-M] [-d]\n"
-           "    [-D] [-S] [-p <parameters>] [-g <w>,<h>] [-l <pixels>]\n"
+           "    [-B <ticks>[,<ticks>]] [-j <n>] [-I] [-P] [-m <mode>] [-M]\n"
+           "    [-d] [-D] [-S] [-p <parameters>] [-g <w>,<h>] [-l <pixels>]\n"
            "    [-f <delay>] [-t] [-T <ticks>[,<ticks>]] [-U] [-z <ms>]\n"
            "    [-Z <skip>] [-q] [-e <command> [<arguments>]]\n\n"
            "Where:\n"
@@ -259,6 +259,8 @@ usage(void)
            "      [?658467;65543[;<n>]h and [?658467;65544h respectively,\n"
            "      where the optional <n> specifies the number of vertical\n"
            "      pixels to jump per frame (1-4).\n"
+           " -I - If the cursor is blinking, do not reset its state to \"on\""
+           "      at user input.\n"
            " -P - If the cursor is blinking, reset its timer for printing.\n"
            "      By default, it is only reset \"on\" by user input.\n"
            " -m - Set default cursor style (0 = block, 1 = line, 2 = bar).\n"
@@ -355,7 +357,7 @@ main(int argc, char **argv, char **envp)
 
        progname = strdup(argv[0]);
        while ((ch = getopt(argc, argv,
-           "?128uw:h:E:scC:Wr:R:bB:j:Pm:MdDStT:p:g:l:f:Uz:Z:qe:")) != -1) {
+           "?128uw:h:E:scC:Wr:R:bB:j:IPm:MdDStT:p:g:l:f:Uz:Z:qe:")) != -1) {
                switch (ch) {
                case '1':
                        cfg_slowscroll = cfg_smoothscroll = true;
@@ -441,6 +443,9 @@ main(int argc, char **argv, char **envp)
                                        cfg_cursorblinkspeedoff = soff;
                        }
                        break;
+               case 'I':
+                       cfg_cursorinputreset = !cfg_cursorinputreset;
+                       break;
                case 'j':
                        if ((i = atoi(optarg)) > 1 && i <= 16)
                                cfg_jumpscrolllines = i;
index c235f8c..e1ccaa3 100644 (file)
@@ -435,7 +435,8 @@ screen_handlekey(XKeyEvent *k, int ptyfd)
        bool swapped = false;
 
 
-       draw_reset_cursor();
+       if (cfg_cursorinputreset)
+               draw_reset_cursor();
 
        (void)XLookupString(k, (char *)&c, 1, &keysym, NULL);
        uc = c;