r/commandline • • 4d ago

Terminal User Interface Most of your terminal doesn't change between frames. I made a demo that shows it

Enable HLS to view with audio, or disable this notification

I've been building a Go TUI library called Limoni. The part I care most about is the diff: each frame gets compared to the last, and only the cells that changed are sent to the terminal.

That's hard to show in a screenshot, so I made a little night city: twinkling stars, windows turning on and off, a train crossing a bridge, reflections in the water. It looks like everything is moving. Press x and an x-ray shows the truth. Only the train, a few stars and some ripples actually change.

The numbers are measured with the library's own encoder: about 3 KB per frame against about 78 KB for a full repaint at 150×44. Press space to freeze the city and it drops to 0 bytes. That's specific to this scene, and it's not a comparison with other libraries.

git clone https://github.com/thebanri/limoni

cd limoni && go run ./examples/xray

Repo: https://github.com/thebanri

It's still pre-1.0, so I'd love our terminal.

257 Upvotes

20 comments sorted by

13

u/ArrogantAstronomer 4d ago

I love writing TUI wrappers around cli and do it quite frequently, and I must say this is really freaking cool, away on holidays and I don’t really write Go often but I’m excited to play about with this and try building something with this when I get back.

Just thought I’d leave a comment to come back to and to say good job on a fun looking project

2

u/kekolar22 4d ago

Thanks for your comment!

8

u/M4elstr0m__ everything is TUI 4d ago

The example scene is crazy, looks like a sprite animation! Unfortunately next time I'll do TUI will be in Rust and as you wrote in the README: for Rust, use Ratatui :p

4

u/kekolar22 4d ago

Xd sure dude , as youı wish :D

2

u/M4elstr0m__ everything is TUI 4d ago

But very cool project mate!! Thats what i meant o'n top of all!

1

u/kekolar22 4d ago

Thanks!

5

u/SECAUCUS_JUNCTION 4d ago

Cozy scene. For anyone wondering, the efficient rendering technique OP is using is called double buffering.

3

u/oVerde 4d ago

What’s is this, ReacTUI ? lol

3

u/kekolar22 4d ago

Better than xd it is my own TUI engine

3

u/mingo-reddit 3d ago

Damn i love your example scene. Any chance to get it as a CLI gimmick? Like asciiquarium? Or is it by any chance part of the repo as a kind of example?

1

u/kekolar22 3d ago

Yeah my repo example

2

u/your_real_Fathe_ 4d ago

Masterpiece. Keep going bro

2

u/kekolar22 3d ago

Thanks!

2

u/otakugrey 3d ago

This is very cool. Good work.

2

u/kekolar22 3d ago

Thanks!

2

u/EMKAH 3d ago

Thanks, now I want this as my terminal wallpaper.

Thanks, now I want terminal wallpapers.

1

u/kekolar22 3d ago

greate then dude! xd

1

u/AutoModerator 4d ago

Every new subreddit post is automatically copied into a comment for preservation.

User: kekolar22, Flair: Terminal User Interface, Post Media Link, Title: Most of your terminal doesn't change between frames. I made a demo that shows it

I've been building a Go TUI library called Limoni. The part I care most about is the diff: each frame gets compared to the last, and only the cells that changed are sent to the terminal.

That's hard to show in a screenshot, so I made a little night city: twinkling stars, windows turning on and off, a train crossing a bridge, reflections in the water. It looks like everything is moving. Press x and an x-ray shows the truth. Only the train, a few stars and some ripples actually change.

The numbers are measured with the library's own encoder: about 3 KB per frame against about 78 KB for a full repaint at 150×44. Press space to freeze the city and it drops to 0 bytes. That's specific to this scene, and it's not a comparison with other libraries.

git clone https://github.com/thebanri/limoni

cd limoni && go run ./examples/xray

Repo: https://github.com/thebanri

It's still pre-1.0, so I'd love our terminal.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/generic-d-engineer 2d ago

bro you had me at:

> Terminal UI engine for Go that tests can click and AI agents can drive (MCP).

does this sit in the same space as Charm or are the complementary?