Show HN: Tattoy – a text-based terminal compositor


About
Tattoy can generally be thought of as a framework for adding eye-candy to your terminal. It is purely text-based so works in any terminal emulator that supports true colour. "Graphics" is rendered with UTF8 half-blocks (▀,▄). Whilst most of its effects are for getting you street credibility it also has more powerful features based around its awareness of terminal contents. For example it can detect and auto adjust text contrast whilst remaining faithful to the terminal's palette.
Tattoy works with your existing shell, theme and prompt, etc. It can always and immediately toggle between its effects and your normal terminal state, allowing for easy copy-pasting for example.
Shaders
Perhaps the fanciest feature of Tattoy is its ability to render GPU shaders. It is designed to be able to run most shaders from Shader Toy without any editing at all. It also supports Ghostty shaders out-of-the-box, though certain shaders that alter the position of text (such as CRT emulators) don't have a pronounced impact as text rendering is always left to the host terminal emulator.
Second Terminal In Background
You can run an arbitrary command that is rendered in the background of your normal terminal. Use-cases for this might be:- an audio visualiser
- video background
- system monitor graphs
Scrollback Minimap
The minimap is a pixelised version of the contents of the scrollback, including the current contents of the screen. It live updates, even when using the so-called "alternate screen" for apps like `nvim`, `top`, `gitui`, etc.Tattoy manages its own scrollback buffer (like say `tmux` does), and so can therefore also provide its own scrollbar.
Auto Text Contrast
Have you ever run `ls` in a directory only for certain file types to be completely illegible? This has long been an intractable problem caused by the limited colours of terminal palettes. CLI applications are only ever aware of palette index values, not the underlying RGB value, therefore it is impossible for them to know if any given background colour is sufficient enough to allow its containing text to be readable.Not anymore!
Tattoy is aware of the true 24 bit RGBA value of all colours in your terminal. This allows it to use clever algorithms to detect low contrast text and auto adjust the foreground colour within the constraints of your chosen terminal theme to find the nearest colour that meets a minimum contrast threshold.
Plugins
Plugins can be written in any language. You get full access to your terminal's contents and can render both UTF8 "pixels" and text to a dedicated plugin layer of your choosing. Currently the protocol is JSON over `STDIN` and `STDOUT`. See the plugin documentation for more info.Here we see the cursor giving off smoke particles that interact with the terminal's text. The source code can be found here.
What's Your Reaction?






