dtinth / ttycast

Broadcast your tty to the world! Stream your live terminal session online. Powered by ttyrec, tty.js and Socket.IO
http://me.dt.in.th/page/ttycast
MIT License
429 stars 23 forks source link

Inverse video doesn't seem to work #7

Closed non closed 11 years ago

non commented 11 years ago

Hi, I'm trying out ttycast as a way of broadcasting Angband games (http://rephial.org/).

So far it's really great but it doesn't seem to support inverse video, which Angband uses by default for walls. I can work around this but it's a bit ugly.

It seems like ttyrec and ttyplay do support inverting the fg and bg colors, so it seems like the problem is in ttycast (or one of its dependencies). Any ideas on fixing this?

Thanks!

non commented 11 years ago

To be specific: the application is printing spaces with a background color of RED, and with A_REVERSE. The result should be solid red, but instead there's solid black.

dtinth commented 11 years ago

Seems like the term.js works a bit strangely. It sometimes switch the background color and foreground color, and it sometimes sets the inverse flag on the buffer. Sometimes it does both.

You should see a fix in the next version...

Testcases for self:

echo $'\e[31m\e[42mhello\e[7mworld\e[27mhi\e[m'
echo $'\e[0m\e[31mhello\e[7mworld\e[27mhi\e[m'
echo $'\e[7mhello\e[0m'
echo $'\e[1;7;32mhello\e[0m'
echo $'\e[1;32;7mhello\e[0m'
echo $'\e[1;32;7;42mhello\e[0m'
echo $'\e[1;32;7;43mhello\e[0m'