AnalogTerm2: Improve README, add/install util/example aliases
authorMatthew Mondor <mmondor@pulsar-zone.net>
Tue, 9 May 2023 19:52:28 +0000 (19:52 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Tue, 9 May 2023 19:52:28 +0000 (19:52 +0000)
mmsoftware/analogterm2/GNUmakefile
mmsoftware/analogterm2/README.txt
mmsoftware/analogterm2/tests/at2-aliases.sh [new file with mode: 0755]

index d90f149..342413c 100644 (file)
@@ -87,6 +87,7 @@ install:
        for f in $(FONTS); do \
                $(INSTALL) -c -o 0 -g 0 -m 644 $$f $(PREFIX)/share/analogterm2 ; \
        done
+       $(INSTALL) -c -o 0 -g 0 -m 755 tests/at2-aliases.sh $(PREFIX)/share/analogterm2 ; \
 
 clean:
        $(RM) -f $(BIN) $(BIN).core $(OBJS)
index 3cb2dd1..4fe4474 100644 (file)
@@ -21,15 +21,23 @@ and XShm support were also added.  Then ISO-8859-2 and ISO-8859-3
 UTF-8 locales only.  Latin-1 can work in either 8-bit mode or UTF-8.
 
 The terminal supports "mono" or 8 colors modes.  In monochrome
-mode, it simulates background color using a medium-intensity inverse
-mode.  Future plans include 2x2.5 zoom and perhaps dynamic window
-resizing and optional pixel-resolution smooth scrolling.  The main
-foreground color can be configured using custom "DEC Private Mode"
-ESC sequences or via the command line arguments.  If you are using
-tmux or screen, these ESC sequences should be issued when detached
-as they are not understood or proxied/forwarded by default.
+mode, it attempts to simulate monochrome monitors that display
+various intensities depending on the luminance of the colors in
+use.  The monochrome mode can be toggled using a special ATC sequence
+or with the command line option -c.
 
-For instance:
+Future plans include 2x2.5 zoom, better text copy and perhaps
+dynamic window resizing and other font sizes.
+
+The main foreground color can be configured using custom "DEC
+Private Mode" ESC sequences or via the command line arguments.  If
+you are using tmux or screen, these ESC sequences should be issued
+when detached as they are not understood or proxied/forwarded by
+default.  A collection of custom alternative fonts and aliases are
+included in the test/ directory, some are also installed by the
+GNUmakefile.
+
+Some ATC sequence examples:
 
 Switch the terminal between color and monochrome modes:
 $ printf '\033[?658467;65536h' ; color
@@ -48,6 +56,10 @@ Alter "1" to have a serif foot.  Some custom fonts can be loaded
 using cat(1) on supplied example files.
 $ printf '\033[?658467;65540;49;7;28h'
 
+Reset to the default font:
+$ printf '\033[?658467;65540h'
+
+
 This terminal was mostly written using AnalogTerm and AnalogTerm2
 itself, tmux and the ViM editor.
 
@@ -94,21 +106,19 @@ not when unnecessary), as well as when src/config.h's JUMP_SCROLL_LINES
 is attained.  The mode can be changed using the DEC Private Mode
 4 sequences ^[[?4l and ^[[?4h.  In slow/immediate update mode, it
 is possible for operations to be slower and more CPU expensive,
-but the visible outcome may be preferable in some cases.  It is
-possible that AnalogTerm1-style pixel-level smooth scrolling
-eventually be implemented as well in this mode.
+but the visible outcome may be preferable in some cases.
 
 In normal refresh mode configured for 30Hz/30FPS (see src/config.h
 for the timers), "mplayer -quiet -vo caca" and cacafire work very
-well with the following: "analogterm2 -c -W -w120 -h50" and changing
+well with the following: "analogterm2 -W -w120 -h50" and changing
 TERM to xterm-256color.  Ninvaders, a very interactive game also
 works nicely.  It was challenging to get this level of performance
 with AnalogTerm1.  From experience, when using xterm as TERM, the
 libcaca library erroneously produces blinking text.  The Blu-ray
 remastered 2001 movie was found to play fine and to have proper
-contrast with "-c -w182 -h67".
+contrast with "-w182 -h67".
 
-When started with -c, AnalogTerm2 supports 8 colors.  It simulates
+When started without -c, AnalogTerm2 supports 8 colors.  It simulates
 a 16-color mode terminal but disregarding the difference between
 low and high brightness intensity colors, except for gray when the
 text attribute is black color and bold, like xterm does.  If you
@@ -118,3 +128,48 @@ the latter, anything below 7 colors unfortunately also affects
 other highlighting like for paren matching.  "monochrome.vim" by
 Xavier Noria was found to work decently.  This is unnecessary if
 running analogterm2 in color mode, obviously.
+
+
+AnalogTerm2 supports asynchronous and independent cursor and text
+blinking delay parameters.  Those for the cursor apply to the
+specific VT520 cursor type in use.  This means that it is possible
+for a less visible underscore cursor to have a faster blinking rate
+than a more visible block cursor in applications that support this
+(i.e. neovim).  Example blinking configuration:
+
+Switch to block cursor and configure it to only blink occasionally:
+$ printf '\033[1 q\033[?658467;65538;50;10h'
+
+Configure underline and vertical bar cursors for faster steady
+blinking:
+$ printf '\033[5 q\033[?658467;65538;6h'
+$ printf '\033[3 q\033[?658467;65538;6h'
+
+Switch back to slow blinking block cursor:
+$ printf '\033[1 q'
+
+
+Another special feature is the support for slow text, something
+that may be useful as an effect, or to study and improve the
+performance of applications or libraries like curses/ncurses.
+
+Force the cursor to always be visible, enable slow scrolling and
+slow BPS simulation:
+$ printf '\033[?658467;65550h\033[?4h\033[?658467;65548;1;16h'
+
+Restore normal/fast text speed, fast/jump scrolling and allow the
+cursor to be invisible again in applications that request it:
+$ printf '\033[?658467;65548;0h\033[?4l\033[?658467;65544h\033[?658467;65549h'
+
+
+Although it could be better, smooth scrolling is also supported.
+Currently, that only works for the whole screen when scrolling from
+the bottom, meaning that this will not work in applications like
+screen/tmux unless the status bar is configured to be at the top
+of the display.
+
+Enable smooth scrolling with 2 pixel jump:
+$ printf '\033[?4h\033[?658467;65543;2h'
+
+Restore fast scrolling:
+$ printf '\033[?4l\033[?658467;65544h'
diff --git a/mmsoftware/analogterm2/tests/at2-aliases.sh b/mmsoftware/analogterm2/tests/at2-aliases.sh
new file mode 100755 (executable)
index 0000000..2d1fab7
--- /dev/null
@@ -0,0 +1,112 @@
+#!/bin/sh
+# Example/utility ANSI and ATC sequences for AnalogTerm ][
+# This file can be sourced from ~/.shrc, ~/.bashrc, etc.
+
+# Display case
+alias atupper="printf '\033[?658467;65545h'"
+alias atlower="printf '\033[?658467;65546h'"
+
+# Scrolling
+alias atsmoothscroll1="printf '\033[?4h\033[?658467;65543h'"
+alias atsmoothscroll2="printf '\033[?4h\033[?658467;65543;2h'"
+alias atsmoothscroll3="printf '\033[?4h\033[?658467;65543;3h'"
+alias atsmoothscroll4="printf '\033[?4h\033[?658467;65543;4h'"
+alias atslowscroll="printf '\033[?4h'"
+alias atfastscroll="printf '\033[?4l\033[?658467;65544h'"
+
+# Text speed
+alias atfasttext="printf '\033[?658467;65548;0h'"
+alias atslowtext1="printf '\033[?658467;65548;1;32h'"
+alias atslowtext2="printf '\033[?658467;65548;1;16h'"
+alias atslowtext3="printf '\033[?658467;65548;1;8h'"
+
+# Color
+alias atcolor="printf '\033[?658467;65536h'"
+alias atmono="printf '\033[?658467;65537h'"
+alias atamber="printf '\033[?658467;8h'"
+alias atamber2="printf '\033[?658467;255;192;128h'"
+alias atamber3="printf '\033[?658467;255;176;0h'"
+alias atamber4="printf '\033[?658467;255;204;0h'"
+alias atgreen="printf '\033[?658467;2h'"
+alias atgreen2="printf '\033[?658467;64;255;176h'"
+alias atgreen3="printf '\033[?658467;128;255;128h'"
+alias atgreen4="printf '\033[?658467;128;255;192h'"
+alias atgreen5="printf '\033[?658467;36;204;68h'"
+alias atgreen6="printf '\033[?658467;51;255;51h'"
+alias atgreen7="printf '\033[?658467;0;255;102h'"
+alias atgreen8="printf '\033[?658467;64;255;164h'"
+alias atgreen9="printf '\033[?658467;170;255;170h'"
+alias atgreen10="printf '\033[?658467;57;255;20h'"
+alias atgreen11="printf '\033[?658467;0;173;131h'"
+alias atgreen12="printf '\033[?658467;152;251;152h'"
+alias atgreen13="printf '\033[?658467;11;218;81h'"
+alias atgreen14="printf '\033[?658467;0;166;147h'"
+alias atgreen15="printf '\033[?658467;85;221;51h'"
+alias atwhite="printf '\033[?658467;7h'"
+alias atwhite2="printf '\033[?658467;200;225;255h'"
+alias atgray="printf '\033[?658467;10h'"
+alias atcyan="printf '\033[?658467;6h'"
+alias atcyan2="printf '\033[?658467;128;255;255h'"
+alias atcyan3="printf '\033[?658467;192;255;255h'"
+alias atblue="printf '\033[?658467;32;150;255h'"
+alias atblue2="printf '\033[?658467;100;192;255h'"
+alias atblue3="printf '\033[?658467;135;206;255h'"
+alias atblue4="printf '\033[?658467;155;226;255h'"
+alias atblue5="printf '\033[?658467;156;248;255h'"
+alias atyellow="printf '\033[?658467;3h'"
+alias atyellow2="printf '\033[?658467;246;223;147h'"
+alias atyellow3="printf '\033[?658467;241;180;47h'"
+alias atyellow4="printf '\033[?658467;244;196;48h'"
+alias atorange="printf '\033[?658467;9h'"
+alias atorange2="printf '\033[?658467;255;121;0h'"
+alias atorange3="printf '\033[?658467;255;140;0h'"
+alias atorange4="printf '\033[?658467;255;165;0h'"
+alias atorange5="printf '\033[?658467;255;117;55h'"
+alias atorange6="printf '\033[?658467;253;153;102h'"
+alias atorange7="printf '\033[?658467;241;180;47h'"
+alias atorange8="printf '\033[?658467;255;159;0h'"
+alias atorange9="printf '\033[?658467;242;133;0h'"
+alias atorange10="printf '\033[?658467;255;117;24h'"
+alias atred="printf '\033[?658467;255;32;72h'"
+alias atred2="printf '\033[?658467;255;34;38h'"
+alias atred3="printf '\033[?658467;255;36;0h'"
+alias atred4="printf '\033[?658467;255;32;164h'"
+alias atred5="printf '\033[?658467;230;32;32h'"
+alias atred6="printf '\033[?658467;255;99;71h'"
+alias atred7="printf '\033[?658467;228;77;46h'"
+alias atred8="printf '\033[?658467;259;128;214h'"
+alias atred9="printf '\033[?658467;227;66;52h'"
+alias atred10="printf '\033[?658467;255;127;127h'"
+alias atred11="printf '\033[?658467;192;128;129h'"
+alias atred12="printf '\033[?658467;206;32;41h'"
+alias atred13="printf '\033[?658467;237;41;57h'"
+alias atred14="printf '\033[?658467;230;0;38h'"
+
+# Cursor control
+alias atcurdisable="printf '\033[?658467;65549h'"
+alias atcurnodisable="printf '\033[?658467;65550h'"
+alias atblink="printf '\033[?13h'"
+alias atnoblink="printf '\033[?13l'"
+alias atfast="printf '\033[?658467;65538;6h'"
+alias atslow="printf '\033[?658467;65538;15h'"
+alias atmixed1="printf '\033[?658467;65538;40;10h'"
+alias atmixed2="printf '\033[?658467;65538;50;10h'"
+alias atbright="printf '\033[?658467;65541h'"
+alias atnobright="printf '\033[?658467;65542h'"
+alias atblock="printf '\033[1 q'"
+alias atline="printf '\033[3 q'"
+alias atbar="printf '\033[5 q'"
+
+# Scanline emulation
+alias atintreset="printf '\033[?658467;65539;0;115h\033[?658467;65539;1;26h\033[?658467;65539;2;230h\033[?658467;65539;3;13h\033[?658467;65539;4;0h'"
+alias atintbright1="printf '\033[?658467;65539;0;150h\033[?658467;65539;1;26h\033[?658467;65539;2;255h\033[?658467;65539;3;16h\033[?658467;65539;4;16h'"
+alias atintbright2="printf '\033[?658467;65539;0;140h\033[?658467;65539;1;26h\033[?658467;65539;2;255h\033[?658467;65539;3;26h\033[?658467;65539;4;26h'"
+alias atintscan1="printf '\033[?658467;65539;0;160h\033[?658467;65539;1;26h\033[?658467;65539;2;32h\033[?658467;65539;3;32h\033[?658467;65539;4;0h'"
+alias atintscan2="printf '\033[?658467;65539;0;160h\033[?658467;65539;1;26h\033[?658467;65539;2;32h\033[?658467;65539;3;16h\033[?658467;65539;4;0h'"
+alias atintscan3="printf '\033[?658467;65539;0;100h\033[?658467;65539;1;35h\033[?658467;65539;2;32h\033[?658467;65539;3;16h\033[?658467;65539;4;0h'"
+alias atintscan4="printf '\033[?658467;65539;0;160h\033[?658467;65539;1;20h\033[?658467;65539;2;8h\033[?658467;65539;3;8h\033[?658467;65539;4;8h'"
+alias atintgrad="printf '\033[?658467;65539;0;100h\033[?658467;65539;1;18h\033[?658467;65539;2;230h\033[?658467;65539;3;13h\033[?658467;65539;4;0h'"
+
+# Font
+alias atdashedzero="printf '\033[?658467;65540;48;0;0h\033[?658467;65540;48;1;28h\033[?658467;65540;48;2;34h\033[?658467;65540;48;3;38h\033[?658467;65540;48;4;42h\033[?658467;65540;48;5;50h\033[?658467;65540;48;6;34h\033[?658467;65540;48;7;28h\033[?658467;65540;48;8;0h'"
+alias atfontreset="printf '\033[?658467;65540h'"