membrane.term icon indicating copy to clipboard operation
membrane.term copied to clipboard

Support more vt text effects

Open lread opened this issue 3 years ago • 7 comments

From #2:

In a similar vein, asciinema/vt already surfaces bold, italic, underline, blink, inverse, and strikethrough. I just implemented bold and italic (inside of emacs running in membrane.term :D), but adding some of the others might be fun at some point.

lread avatar Oct 31 '21 17:10 lread

Looking at SGR codes and FWIW,

  • :tv: comparing with what iTerm2 on macOS seems to support
  • :package: asciinema/vt includes/handles in its abstraction
  • :fireworks: already done/handled in membrane.term
  • :ear_of_rice: usage seems truly or nearly obscure

Codes:

  • 0 :tv: :package: :fireworks: clear all
  • 1 :tv: :package: :fireworks: bold
  • 2 :tv: dim - often implemented with light font weight.
  • 3 :tv: :package: :fireworks: italic is not widely supported (go us!) (off by default in iTerm2)
  • 4 :tv: :package: underline
  • 5 :tv: :package: slow blink (off by default in iTerm2)
  • 6 :ear_of_rice: rapid blink (not widely supported)
  • 7 :tv: :package: invert
  • 8 :ear_of_rice: hide (not widely supported)
  • 9 :tv: :package: strikeout
  • 10 :ear_of_rice: primary font
  • 11-19 :ear_of_rice: alternative fonts
  • 20 :ear_of_rice: Fraktur
  • 21 :package: not bold (or sometimes double underline) asciinema/tv sees it as not bold
  • 22 :tv: :package: Normal intensity
  • 23 :tv: :package: Not italic
  • 24 :tv: :package: Not underlined
  • 25 :tv: :package: Not blinking
  • 26 :ear_of_rice: Proportional (not known to be used in any terminal)
  • 27 :tv: :package: Not inverted
  • 28 :ear_of_rice: Reveal
  • 29 :tv: Not strikeout (I think that :package: missed this one)
  • 30-38 :tv: :package: :fireworks: foreground color
  • 39 :tv: :package: :fireworks: Use default foreground color
  • 40-48 :tv: :package: :fireworks: background color
  • 49 :tv: :package: :fireworks: Use default background color
  • 50 :ear_of_rice: Disable proportional (see 26)
  • 51 :ear_of_rice: Framed
  • 52 :ear_of_rice: Encircled
  • 53 :ear_of_rice: Overlined
  • 54 :ear_of_rice: Neither framed nor encircled
  • 55 :ear_of_rice: Not overlined
  • 58 :ear_of_rice: Set underline color
  • 59 :ear_of_rice: Default underline color
  • 60-65 :ear_of_rice: Ideogram (rarely supported)
  • 73 :ear_of_rice: Superscript
  • 74 :ear_of_rice: Subscript
  • 75 :ear_of_rice: Neither superscript or subscript
  • 90-97 :tv: :package: :fireworks: Bright foreground color
  • 100-107 :tv: :package: :fireworks: Bright background color

lread avatar Oct 31 '21 22:10 lread

So, in addition to adding support for:

  • underline
  • blink
  • inverse
  • strikethrough

We might also consider adding support for dim. We'd need to tweak our fork of asciinema/tv to do that, I think. And while we were in there we might consider having it recognize not strikeout.

lread avatar Oct 31 '21 22:10 lread

fwiw, I've already forked aciinema/vt

phronmophobic avatar Oct 31 '21 23:10 phronmophobic

Perfect!

lread avatar Oct 31 '21 23:10 lread

Blink and screenshot might be at odds! Just a thought. Not that anybody uses blink, more implementing for the fun of it. So maybe not worth an option to enable/disable blink.

lread avatar Nov 01 '21 02:11 lread

Hmmm... just testing my new script from #11 on GNOME Terminal 3.36.2 on Linux Mint and it supports more of the things.

It'll blink on code 6 (albeit no faster than it does for code 5). It hides on code 8 (and probably reveals on code 28). It does double underlines for code 21. And overlines for code 53 (and probably 55 too). And it supports changing your underline color via code 58 (and probably 59 too).

Go figure!

lread avatar Nov 01 '21 03:11 lread

Blink and screenshot might be at odds!

Maybe that just means we to add cli-media support so we can make gifs!

phronmophobic avatar Nov 01 '21 03:11 phronmophobic