AnalogTerm2: Added control sequences for uppercase and scroll skip
authorMatthew Mondor <mmondor@pulsar-zone.net>
Tue, 2 May 2023 06:58:22 +0000 (06:58 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Tue, 2 May 2023 06:58:22 +0000 (06:58 +0000)
mmsoftware/analogterm2/TODO.txt
mmsoftware/analogterm2/src/main.c
mmsoftware/analogterm2/src/state.c

index d4923ae..2c79200 100644 (file)
@@ -1,6 +1,3 @@
-- Now that the smooth scrolling pixel-skip can be configured, probably adapt
-  the 65543 ATC sequence to support a parameter.  Currently only the -2
-  command line option or config.h allow to change it.
 - Many operations are the equivalent of newline or scroll if the end of the
   scrolling buffer or bottom are reached.  Unify those in a function or two as
   possible.
@@ -38,7 +35,7 @@
   https://en.wikipedia.org/wiki/Box-drawing_character
 - Overwrite/clear selections before freeing them
 - ≣ † ☆ ツ ⌘›🍺∴ ( ͡° ͜ʖ ͡°)   ƒ   ︵  ₂   😈  θ  ƒ  ›  ʼ  ƒ ∂  ʻ  μ  ›  ∫   ◇ ♪
-  ► ə β ə ſ ρ ə ∴ ♪ 😱 † 😳 › ▛ ᵗ *
+  ► ə β ə ſ ρ ə ∴ ♪ 😱 † 😳 › ▛ ᵗ * ‽
 - 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 d6e2500..401b7bb 100644 (file)
@@ -209,6 +209,7 @@ usage(void)
            "    [-U] [-z <ms>] [-Z <skip>] [-e <command> [<arguments>]]\n\n"
            "Where:\n"
            " -1 - Activate slow and smooth scrolling at startup.\n"
+           "      Also see -j for more details.\n"
            " -2 - Like -1 but scrolls at 2x speed (2 pixels per frame).\n"
            " -8 / -u - 8-bit mode (Latin-1), unicode+UTF-8.  8-bit mode is\n"
            "           automatically enabled by default if the LANG\n"
@@ -241,13 +242,15 @@ usage(void)
            "      Jump scroll is the default but can be changed with the\n"
            "      DEC Private Mode sequence 4: [?4h and [?4l.  Pixel-level\n"
            "      smooth scrolling may also be enabled and disabled when\n"
-           "      slow scrolling is also enabled with the [?658467;65543h\n"
-           "      and [?658467;65544h special sequences, respectively.\n"
+           "      slow scrolling is also enabled with the special sequences\n"
+           "      [?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"
            " -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"
            " -M - Enable very visible cursor mode by default.\n"
-           "      Can also be controlled with the escape sequences \n"
+           "      Can also be controlled with the escape sequences\n"
            "      [?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"
@@ -265,6 +268,8 @@ usage(void)
            "      While this function could eventually be more complete,\n"
            "      it only currently works with ASCII characters.\n"
            "      May be problematic with case-sensitive data like files.\n"
+           "      Can also be controlled with the special escape sequences\n"
+           "      [?658467;65545h and [?658467;65546h.\n"
            " -z - Slow bandwidth/bps simulation.  Sleep the specified\n"
            "      number of milliseconds before reading each byte from the\n"
            "      application tty(4).  Will also affect the rate of input\n"
index f64be5c..b72dcc3 100644 (file)
@@ -1122,14 +1122,36 @@ state_emul_printc(state_t *st, uint8_t c)
                                                            = false;
                                                } else if (p == 65543) {
                                                        st->scroll_smooth =
-                                                          st->scroll_slow =
-                                                          true;
+                                                           st->scroll_slow =
+                                                           true;
+                                                       cfg_smoothscrollskip =
+                                                           1;
                                                } else if (p == 65544) {
                                                        st->scroll_smooth =
                                                           false;
                                                        st->scroll_slow =
                                                           cfg_slowscroll;
+                                               } else if (p == 65545) {
+                                                       cfg_uppercaseview =
+                                                           true;
+                                                       st->text_updateall =
+                                                           true;
+                                               } else if (p == 65546) {
+                                                       cfg_uppercaseview =
+                                                           false;
+                                                       st->text_updateall =
+                                                           true;
                                                }
+                                       } else if ((state->curparam == 2 &&
+                                                   state->csiparam[1] ==
+                                                   65543)) {
+                                               st->scroll_smooth =
+                                                   st->scroll_slow = true;
+                                               cfg_smoothscrollskip = 1;
+                                               if (state->csiparam[2] > 0 &&
+                                                   state->csiparam[2] < 5)
+                                                       cfg_smoothscrollskip =
+                                                           state->csiparam[2];
                                        } else if ((state->curparam == 2 ||
                                                    state->curparam == 3) &&
                                                   state->csiparam[1] ==