- Update TODO
authorMatthew Mondor <mmondor@pulsar-zone.net>
Fri, 8 Apr 2022 09:36:17 +0000 (09:36 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Fri, 8 Apr 2022 09:36:17 +0000 (09:36 +0000)
- Improve pseudocolors implementation.  We used to ignore setting
  the black color, but now treat it as restoring default/none color.
- Import example analogterm screenshot in MATT/

MATT/TODO.txt
MATT/analogterm-vim.png [new file with mode: 0644]
hacks/analogterm-main.c

index b641a53..5580c77 100644 (file)
@@ -3,6 +3,14 @@ BUILD
 - make
 
 TODO
+- Currently, blinking also implies inverse, but inverse takes precedence,
+  stopping blinking when both are enabled.  Perhaps implement blinking like
+  xterm does, where the text can be normal or inverse while blinking or not.
+  In blinking+reverse mode, the background should not blink but the foreground
+  text should.
+- All uint8_t mode bits are already allocated.  Ideally we would need a larger
+  word but this will affect operations using memset(3), memmove(3) and
+  memcpy(3).  Double-underline, italics and striked currently lack a mode bit.
 - There's an apparent bug in utf8wc.c's utf8_split() function.
   Does not appear to be used by analogterm itself but is included
   as a module because of other functions in use.
@@ -51,6 +59,11 @@ TODO
   Various key sequences are not properly supported, smacs (DEC
   Special Graphics) issues ^N instead of \E(0, underline mode is
   unsupported, etc.  Let's use xterm and simulate pseudocolors instead.
+  It would still be interesting to carefully look at the entry to determine
+  what affects the behavior of applications, like determining if colors are
+  available or not.  The "colors" terminfo entry depends on the terminfo entry
+  set in $TERM and is not a terminal-related code, only a number.  This means
+  that a custom xterm copy for analogterm would be necessary to reply on that.
 - Our font's '3' is a bit strange, its separator likely too low.
   Make sure to also update the graphics character set.
 - Our font's 'R' is a bit strange.
diff --git a/MATT/analogterm-vim.png b/MATT/analogterm-vim.png
new file mode 100644 (file)
index 0000000..b4d5308
Binary files /dev/null and b/MATT/analogterm-vim.png differ
index 9fee557..c663643 100644 (file)
@@ -664,11 +664,6 @@ at_vt100_printc (analogterm_sim_t *sim, struct terminal_controller_data *state,
          state->escstate = 0;
          break;
         case 'm': /* Set text attributes */
-         /*
-          * XXX We possibly could have better support here, including
-          * italics.  Also review from the code charts.
-          * Perhaps even colors...
-          */
          if (state->curparam == -1)
                  state->curparam = 0;
           for (i = 0; i <= state->curparam; i++)
@@ -682,6 +677,7 @@ at_vt100_printc (analogterm_sim_t *sim, struct terminal_controller_data *state,
                   break;
                /* Enable */
                 case 1:
+               case 6: /* FALLTHROUGH */
                  /* Mutually exclusive */
                  state->mode |= TMODE_BOLD;
                  state->mode &= ~TMODE_DIM;
@@ -698,12 +694,20 @@ at_vt100_printc (analogterm_sim_t *sim, struct terminal_controller_data *state,
                 case 5:
                  state->mode |= TMODE_BLINK;
                   break;
-                case 7:
+               case 3: /* Italics, using inverse like urxvt. */
+                case 7: /* FALLTHROUGH */
                  state->mode |= TMODE_INVERSE;
                   break;
+               case 8: /* XXX Invisible, not yet implemented. */
+                 break;
+               case 9: /* XXX Striked, not yet implemented. */
+                 break;
                /* XXX Enable colors, converted to other attributes */
                /* Foreground color */
-               /*case 30: XXX Ignore black fg color for now. */ 
+               case 30: /* Black/default fgcolor */
+               case 90: /* FALLTHROUGH */
+                 state->mode &= ~TMODE_FGCOLOR;
+                 break;
                case 31: /* FALLTHROUGH */
                case 32: /* FALLTHROUGH */
                case 33: /* FALLTHROUGH */
@@ -711,10 +715,20 @@ at_vt100_printc (analogterm_sim_t *sim, struct terminal_controller_data *state,
                case 35: /* FALLTHROUGH */
                case 36: /* FALLTHROUGH */
                case 37: /* FALLTHROUGH */
+               case 91: /* FALLTHROUGH */
+               case 92: /* FALLTHROUGH */
+               case 93: /* FALLTHROUGH */
+               case 94: /* FALLTHROUGH */
+               case 95: /* FALLTHROUGH */
+               case 96: /* FALLTHROUGH */
+               case 97: /* FALLTHROUGH */
                  state->mode |= TMODE_FGCOLOR;
                  break;
                /* Background color */
-               /*case 40: XXX Ignore black bg color for now. */
+               case 40: /* Black/default bgcolor */
+               case 100: /* FALLTHROUGH */
+                 state->mode &= ~TMODE_BGCOLOR;
+                 break;
                case 41: /* FALLTHROUGH */
                case 42: /* FALLTHROUGH */
                case 43: /* FALLTHROUGH */
@@ -722,6 +736,13 @@ at_vt100_printc (analogterm_sim_t *sim, struct terminal_controller_data *state,
                case 45: /* FALLTHROUGH */
                case 46: /* FALLTHROUGH */
                case 47: /* FALLTHROUGH */
+               case 101: /* FALLTHROUGH */
+               case 102: /* FALLTHROUGH */
+               case 103: /* FALLTHROUGH */
+               case 104: /* FALLTHROUGH */
+               case 105: /* FALLTHROUGH */
+               case 106: /* FALLTHROUGH */
+               case 107: /* FALLTHROUGH */
                  state->mode |= TMODE_BGCOLOR;
                  break;
                /* Disable */
@@ -735,9 +756,14 @@ at_vt100_printc (analogterm_sim_t *sim, struct terminal_controller_data *state,
                 case 25:
                  state->mode &= ~TMODE_BLINK;
                   break;
-                case 27:
+               case 23: /* Italics implemented with inverse like rxvt */
+                case 27: /* FALLTHROUGH */
                  state->mode &= ~TMODE_INVERSE;
                   break;
+               case 28: /* XXX Visible, not yet implemented. */
+                 break;
+               case 29: /* XXX Not striked, not yet implemented. */
+                 break;
                 case 39: /* Default fg color */
                  state->mode &= ~TMODE_FGCOLOR;
                  break;