- 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.
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.
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++)
break;
/* Enable */
case 1:
+ case 6: /* FALLTHROUGH */
/* Mutually exclusive */
state->mode |= TMODE_BOLD;
state->mode &= ~TMODE_DIM;
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 */
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 */
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 */
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;