Hacker News new | past | comments | ask | show | jobs | submit login
Ncurses Programming How to (2005) (tldp.org)
60 points by brudgers on Jan 18, 2016 | hide | past | web | favorite | 20 comments



People seem to forget that ncurses is very low level and more equivalent to the painting engine of a GUI toolkit than to the toolkit itself.

The YaST project has a library called libyui ( https://github.com/libyui , C++) that provides a widget library with multiple backends: Qt, Gtk and also Ncurses.

The ncurses implementation has internally a very powerful wrapper on top of curses that does layout and other things you would only find in GUI toolkits.

I have always dreamed of extracting this code from the ncurses backend and making it a generic library, hopefully with a C API to allow for easy binding but I never got to it.

Closes thing I have found is python specific: http://urwid.org and some Java stuff like http://bmsi.com/tuipeer .

Miguel de Icaza also wrote a very nice toolkit for .NET ( http://www.mono-project.com/docs/tools+libraries/libraries/m... ) and it is also one of the most useful libraries out there, but it is still nowhere as powerful as the YaST one in terms of automatic layouts.

The world needs a good ncurses toolkit. Usability is a camp dominated by graphic designers, but I have never seen users happier than my dad using Quattro Pro in text mode.


This reminds me when I just moved at the beginning of my first uni year. I had no Internet connection at my place for the first month, so to entertain myself I decided to write a Tetris in the terminal. I knew C fairly well already but I had never used ncurses nor did any system programming. I ended up learning ncurses and UNIX signals mechanisms solely from the man pages. Good times.


Ncurses is a pretty low level to target, nowadays. I’d recommend something like Urwid (for Python) or similar higher-level for your language of choice.


If you want some kind of abstraction termbox is a pretty reasonable level above straight ncurses. There's also termbox-go fwiw. https://github.com/nsf/termbox https://github.com/nsf/termbox-go


Do you have any good links to documentation / examples for termbox? That's been the biggest missing piece for looking into it in my limited spare time.


Do you know of any for Ruby? Most of them seemed abandoned when I looked around.

Ruby used to ship with ncurses-support built-in but it was fairly low-level and it moved to https://github.com/ruby/curses


Ncurses is my preferred tools still.

look at ranger FIle Manager with VIM shortcuts. The fastest and best File Manager I have ever used. http://ranger.nongnu.org/


Surprisingly I stopped using it because a few times, it was lagging.


Well it is built on Python and for the life of me I never have a consistent experience with several python tools. (I still love Python, but I have really stopped using it personally)


Yeah, I know, I didn't expect blazing fast, it was just that too much slow for me to notice and stop caring. Retrying now, maybe python changed, maybe I did, maybe my laptop.


Ranger hicups very rearly. The speed of doing my files is just way to easy. I love :bulkrename with vim opens up and I change the file names in Vim :wq and boom files renamed.


It varies hugely for a single user (me).


That looks _fantastic_. Thanks!


If you like having media previews in console windows, terminology is also a lot of fun.


For those who have as much difficulty googling this as I did: https://www.enlightenment.org/about-terminology


ranger does this with image previews in xterm/uxterm and rxvt/urxvt.


Like Turbo Vision? :)


The world needs more TUI.


The author of this howto and I were best friends back in college. Good times.


Call him up and be friends again.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: