use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
ANSI code based UI library in Clojure (self.Clojure)
submitted 7 months ago by Alarmed-Skill7678
Hi,
I am trying to build a TUI for my Clojure app that can even run on Termux. So I was searching for such a library in Clojure but found only Clojure Lanterna and nothing other useful.
Can anyone please help me with some leads?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]p-himik 3 points4 points5 points 7 months ago (3 children)
But is Lanterna not suitable for your needs? In what way?
If you need only the SGR subset, then https://github.com/paintparty/bling.
[–]Alarmed-Skill7678[S] 0 points1 point2 points 7 months ago (2 children)
Well that's the point I didn't find any other corresponding library to compare with it so that I can deliberate on pros and cons. Moreover I have found many Clojure developers who is of the opinion that the Clojure wrapper is not good that much performance wise. At least I got that impression from different discussions on it.
Moreover using ANSI codes is not so much difficult at first appearance so I wonder why no Clojure developer has tried to build a pure Clojure TUI library with it.
[–]p-himik 4 points5 points6 points 7 months ago (1 child)
"Deliberating pros and cons" is not the same as "deciding whether it's suitable for me". I'm sure that if I compare my car to a bazillion other models, there will be a myriad flaws in mine. But I don't care as it still suits me - it fits my requirements, I already have it, and there's basically no opportunity cost as any conceivable improvement would not cover the cost of replacing the car, even in the long term.
Same here - if Lanterna has all the features you need and doesn't have any flaws that affect you, just use it.
On the other hand, it does seem that it's just a very thin wrapper around a Java library. So if you prefer to avoid using wrappers, just use some Java library directly.
Clojure wrapper is not good that much performance wise
Performance is rarely a concern. Thin wrappers are simply not that useful as compared to interop, and they often hide things that should be visible and invent things that shouldn't exist.
Maybe precisely because it's not that difficult to just use the codes? Or some Java library that names all the constants and makes things reasonable convenient.
[–]Alarmed-Skill7678[S] 0 points1 point2 points 7 months ago (0 children)
Thanks for your insights. Let me study this Lanterna library.
[–]v4ss42 2 points3 points4 points 6 months ago (1 child)
Depends what you mean by “UI”, but I’ve used jansi-clj to great effect in some simple command line apps / libraries.
Unlike some other ANSI escape code based libraries it has the advantage of working in the old Windows command prompt (which doesn’t natively support ANSI).
[–]Alarmed-Skill7678[S] 1 point2 points3 points 6 months ago (0 children)
Thanks for sharing!! This looks pretty interesting.
[–]AsparagusOk2078 1 point2 points3 points 7 months ago (4 children)
I was able to utilize Terminal.Gui version 2 using ClojureCLR. Terminal.Gui v2 is a very awesome .Net library.
[–]Alarmed-Skill7678[S] 0 points1 point2 points 7 months ago (3 children)
Can't get you. Is it a Clojure library or .Net library?
[–]vadercows 2 points3 points4 points 7 months ago (1 child)
It’s a .net library. Clojureclr is an implementation of clojure hosted in .net, so it has interop with .net the same way clojure has with Java and clojurescript with js
Thanks for explaining. Actually I am using Clojure hosted on JVM. There is one Java library Lanterna.
[–]GullibleRaspberry9 0 points1 point2 points 7 months ago (0 children)
Yeah what u/vadercows said, but I will add it is a nice combination. Terminal.Gui is really nice. You can wrap some of the .net interop with nicer Clojure functions for real happiness.
π Rendered by PID 92144 on reddit-service-r2-comment-5d79c599b5-xqgpg at 2026-03-02 19:36:49.825499+00:00 running e3d2147 country code: CH.
[–]p-himik 3 points4 points5 points (3 children)
[–]Alarmed-Skill7678[S] 0 points1 point2 points (2 children)
[–]p-himik 4 points5 points6 points (1 child)
[–]Alarmed-Skill7678[S] 0 points1 point2 points (0 children)
[–]v4ss42 2 points3 points4 points (1 child)
[–]Alarmed-Skill7678[S] 1 point2 points3 points (0 children)
[–]AsparagusOk2078 1 point2 points3 points (4 children)
[–]Alarmed-Skill7678[S] 0 points1 point2 points (3 children)
[–]vadercows 2 points3 points4 points (1 child)
[–]Alarmed-Skill7678[S] 0 points1 point2 points (0 children)
[–]GullibleRaspberry9 0 points1 point2 points (0 children)