Skip to content

Show HN: Lip Gloss is a CSS-like layout library for the terminal for Go

github.com/charmbracelet
45 pointschristianrocha6 comments
On HN

Comments

Their bubbletea and charms libraries are two of the most amazing go libraries for creating cli apps I have had the pleasure of using.

How can it detect termin background color?

This is the function they are using to detect the background color:

https://github.com/muesli/termenv/blob/d1b90ad4a4915162648dd...

(There’s a different version of it for Windows.)

The windows one just returns default black, which is correct in most cases since very few change it to something else.

https://github.com/muesli/termenv/blob/d1b90ad4a4915162648dd...

This is not entirely true: Windows Powershell defaulted to a blue background. Though this is admittedly an edge case, as Windows Powershell is now deprecated in favour of Powershell Core (which has a black background) IIRC.

GNU libtextstyle, part of gettext, includes CSS styling for ANSI terminal emulator text output.

For some values of "CSS" and "ANSI".

I will dig into a bit when I return to office computer...

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.