Live data from Hacker News

Ask HN: Recommendations for Good TUI Libraries (Text User Interface)?

news.ycombinator.com

51–60 of 64 posts

Re: Ask HN: Recommendations for Good TUI Libraries (Text User Interface)?

#51
post #33

You can't go wrong with Ncurses. Ancient, bindings to literally every language, stable and works everywhere including the kitchen sink. The terminal is not meant to be existing. You are emulating 80 year old technology at the base of it.

Using a higher-level wrapper is going to be way more portable since they handle all the gotchas. And also, ncurses is just highly unpleasant to use directy

Re: Ask HN: Recommendations for Good TUI Libraries (Text User Interface)?

#52
post #20

My favorite is the python-based Urwid library at http://www.urwid.org . It was a little hard for me to wrap my head around it at first, but once you get it, you can write TUI applications without a lot of code. Easy to install, many examples to work from.

Seconding this, it’s what I used for my https://github.com/wtheisen/TerminusBrowser project and while it is a little weird the number of features and modes you can get out of it are fantastic

Re: Ask HN: Recommendations for Good TUI Libraries (Text User Interface)?

#53
post #39

Check out the Interactive Fiction competition, it's text-based video games. https://ifcomp.org/comp/2019 Two libraries for writing these games: https://en.wikipedia.org/wiki/Inform https://en.wikipedia.org/wiki/TADS

If you want a Terminal Nintendo Emulator check out https://justine.storage.googleapis.com/nesemu1.html

Re: Ask HN: Recommendations for Good TUI Libraries (Text User Interface)?

#54

Earlier quoted context omitted.

So, lynx? https://en.wikipedia.org/wiki/Lynx_(web_browser)

No, I meant a text mode browser that does not use HTML. Lynx, and all the existing text mode browsers are intended to render HTML as text. This would be a browser that targets only text mode user interfaces. So pages would need to be written specifically to be rendered in such an environment. Why? Because text mode browsers are really trying to do the impossible - to render modern web pages as text is essentially not…

Sounds like gopher?

https://en.m.wikipedia.org/wiki/Gopher_(protocol)

There was a sliver of time in the 1990s, in academic settings, where it was very easy to get onto an Internet-connected Unix computer, but before HTML existed. There were many plain text Internet applications.

Re: Ask HN: Recommendations for Good TUI Libraries (Text User Interface)?

#56

https://github.com/chjj/blessed is a curses-like library with a high level terminal interface API for node.js. It also has impressive demos.

Now that is a clever project name

Check out blessings - https://news.ycombinator.com/item?id=24423590

Re: Ask HN: Recommendations for Good TUI Libraries (Text User Interface)?

#58
post #23

Turbo Vision, this is TUI perfection. https://en.wikipedia.org/wiki/Turbo_Vision

Ah, I remember this. This is friendly UI

Indeed it was! This library produced easily discoverable UIs, it worked just as well with the keyboard or the mouse. The default layout was very pleasant.

From the developer's perspective, it was a joy to work with. I made some projects using pascal and C++ if I remember correctly.

Re: Ask HN: Recommendations for Good TUI Libraries (Text User Interface)?

#59
post #33

You can't go wrong with Ncurses. Ancient, bindings to literally every language, stable and works everywhere including the kitchen sink. The terminal is not meant to be existing. You are emulating 80 year old technology at the base of it.

When I saw this message I was reminded of a post I read recently:

http://xn--rpa.cc/irl/term.html

Here's how it starts:

"so here's a short tutorial on ansi escape codes and terminal control, because you philistines won't stop using ncurses and oh my god WHY ARE WE STILL USING NCURSES IT IS THE TWENTY FIRST FUCKING CENTURY"

Re: Ask HN: Recommendations for Good TUI Libraries (Text User Interface)?

#60
post #26
post #20

My favorite is the python-based Urwid library at http://www.urwid.org . It was a little hard for me to wrap my head around it at first, but once you get it, you can write TUI applications without a lot of code. Easy to install, many examples to work from.

How popular is it in the Python space? I loved the large text widget and would love to contribute with a font using the Teletext 2x3 mosaics that got into Unicode 13 (which are fully supported in VTE)

You can check out download stats stats for Urwid on PyPI Stats [1], that should give you a decent idea of its popularity.

Also check out the list of applications built with Urwid [2]. Probably the two most popular applications that use Urwid are bpython [3] (an alternative Python REPL that is really nice), and PUDB [4] (a nice Python debugger that is reminiscent of Borland's Turbo Pascal). I use bpython all the time, it's a lifesaver, and I occasionally fire up PUDB when I am really stuck on something.

I've used Urwid in a couple of projects (most notably Zeitzono [5]), it's nice in that it's fairly high level and gives you a number of helpful widgets to work with. Starting with it from scratch is a little daunting, so you should look at existing projects to see how they are using the library. Also, I believe Urwid development has slowed down somewhat in the last few years (although other folks maybe stepping up to take over from the original author, I haven't follow up on this in a while).

Also definitely take a look at Python Prompt Toolkit [6]. They started off as library for writing line-oriented command interpreters, but now can also be used for building full screen applications. I've not yet built an application using it, but it looks really good and is actively developed. ptpython [7] is a REPL built using this library and gives bpython a run for its money.

[1] https://pypistats.org/packages/urwid

[2] https://github.com/urwid/urwid/wiki/Application-list

[3] https://bpython-interpreter.org/

[4] https://github.com/inducer/pudb

[5] https://zeitzono.org/

[6] https://github.com/prompt-toolkit/python-prompt-toolkit

[7] https://github.com/prompt-toolkit/ptpython

Post reply on HN