From: Matthew Mondor Date: Sat, 4 Nov 2023 22:27:56 +0000 (+0000) Subject: AnalogTerm2: Add -I to disable resetting cursor on for input. X-Git-Url: http://git.pulsar-zone.net/?a=commitdiff_plain;h=323b8907a221f3f7de007770e1396c06fbb972c9;p=mmondor.git AnalogTerm2: Add -I to disable resetting cursor on for input. --- diff --git a/mmsoftware/analogterm2/TODO.txt b/mmsoftware/analogterm2/TODO.txt index a868f8c..47ad429 100644 --- a/mmsoftware/analogterm2/TODO.txt +++ b/mmsoftware/analogterm2/TODO.txt @@ -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 diff --git a/mmsoftware/analogterm2/src/config.c b/mmsoftware/analogterm2/src/config.c index 20bb64d..9093bab 100644 --- a/mmsoftware/analogterm2/src/config.c +++ b/mmsoftware/analogterm2/src/config.c @@ -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; diff --git a/mmsoftware/analogterm2/src/config.h b/mmsoftware/analogterm2/src/config.h index ef79213..22a9348 100644 --- a/mmsoftware/analogterm2/src/config.h +++ b/mmsoftware/analogterm2/src/config.h @@ -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; /* diff --git a/mmsoftware/analogterm2/src/main.c b/mmsoftware/analogterm2/src/main.c index 4487b71..2248c2a 100644 --- a/mmsoftware/analogterm2/src/main.c +++ b/mmsoftware/analogterm2/src/main.c @@ -209,8 +209,8 @@ usage(void) (void)printf( "\nUsage: %s [-1 | -2] [-8|-u] [-w ] [-h ] [-E ]\n" " [-s] [-C ] [-c] [-W] [-b] [-r ] [-R ]\n" - " [-B [,]] [-j ] [-P] [-m ] [-M] [-d]\n" - " [-D] [-S] [-p ] [-g ,] [-l ]\n" + " [-B [,]] [-j ] [-I] [-P] [-m ] [-M]\n" + " [-d] [-D] [-S] [-p ] [-g ,] [-l ]\n" " [-f ] [-t] [-T [,]] [-U] [-z ]\n" " [-Z ] [-q] [-e []]\n\n" "Where:\n" @@ -259,6 +259,8 @@ usage(void) " [?658467;65543[;]h and [?658467;65544h respectively,\n" " where the optional 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; diff --git a/mmsoftware/analogterm2/src/screen.c b/mmsoftware/analogterm2/src/screen.c index c235f8c..e1ccaa3 100644 --- a/mmsoftware/analogterm2/src/screen.c +++ b/mmsoftware/analogterm2/src/screen.c @@ -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;