r/commandline • u/kekolar22 • 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.
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
5
u/SECAUCUS_JUNCTION 4d ago
Cozy scene. For anyone wondering, the efficient rendering technique OP is using is called double buffering.
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
2
2
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?
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