Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

ncurses seems powerful. Any good suggestions on a tutorial or introduction to ncurses (which it appears is what was used for the ui here)? Ideally for python, or generalized... Or is there a better tool to learn for generic command line UIs?


Kilo is a great way to learn how to manipulate the terminal directly (rather than using a wrapper library like ncurses): https://github.com/antirez/kilo (A text editor in less than 1000 LOC with syntax highlight and search.)


There are many forks of this, which I think is a testament to how simple, clean, and easy to modify this code was.

The initial blog-post which announced the editor is worth a read, as is the discussion here:

http://antirez.com/news/108

https://news.ycombinator.com/item?id=12065217

My own version adds Lua support, multiple buffers, and similar features. It is by no means the best of the editors but I had fun playing with it - to the extent I was almost tempted to write an editor. (But then I realized I already have vim for writing email, and emacs for everything else. The world really doesn't need another editor!)

https://github.com/skx/kilua/


Member of rust interner task force here. Check out termion, it's so much simpler than raw ncurses.

While you're at it, consider rewriting everything you have in Rust. (obligatory statement as the member of ritf)

PS: the termion suggestion is not a joke


If you want to build interactive terminal interfaces, check out blessed [0]. Even better, you can use react-blessed [1] to write declarative UI code! You can also find additional widgets in blessed-contrib [2].

For actually shipping the code around, you could use pkg [3] to generate a single binary. That lets you avoid having to install node or any supporting libraries.

[0] https://github.com/chjj/blessed

[1] https://github.com/Yomguithereal/react-blessed

[2] https://github.com/yaronn/blessed-contrib

[3] https://github.com/zeit/pkg


Used npyscreen http://npyscreen.readthedocs.io/index.html for a few things. Can recommend.




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

Search: