GeertJohan / gomatrix

Displays "The Matrix" in a terminal
BSD 2-Clause "Simplified" License
293 stars 68 forks source link

Use Tcell for more goodness #8

Closed gdamore closed 8 years ago

gdamore commented 9 years ago

I'm posting this here mostly for information; whether you choose to accept this PR is entirely up to you -- I have no particular vested interest.

The commit comments are pretty clear -- apart from greater portability and usability on non-UTF-8 terminals, the main benefit is a little fancier display on nicer terminals. In particular, I use bright green for the first two elements in every stream, and for roughly 33% of them I actually make the first glyph bright white. This is possible because Tcell has a richer understanding of colors. Note that on terminals with fewer than 16 colors we still use your original color scheme.

I also fixed your event loop to not use an anonymous function -- instead its a flag variable, so we don't even need to have a label.

Oh, and thanks for doing the original work here. Its pretty cool. :-)

GeertJohan commented 9 years ago

Thanks! Gomatrix is one of my first open-sourced Go projects, there are quite a few things I would do differently when writing it today.

I'll leave this PR open to see what happens with Tcell. Might merge this when Tcell gets more usage. Thanks!

GeertJohan commented 8 years ago

Hey @gdamore After PR #9 I've manually merged these changes onto the master branch. I'm interested to see where Tcell is heading. If you have more changes for goodness for gomatrix I'd be happy to get them in!

Cheers!