Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write interactive program like Top? [closed]

When you run the top, you enter an interactive display that is housed in the terminal, yet the command line is gone.

I want to build a program with this type of display, but don't even know what to research.

  • Where do I start?
like image 650
Nate Avatar asked Feb 09 '23 21:02

Nate


1 Answers

top used curses when it was first released, but later switched to its own screen management code because of the overhead associated with curses.

More about top can be read under the following link:

  • http://www.unixtop.org/about.shtml

Collectively, what you are looking for falls under the category of TUI (Text-based User Interface).


Most often ncurses is the goto recommendation for someone that wants to incorporate textual representation of "graphics" inside a terminal.

There are however several different alternatives, and I would recommend google for finding a suitable library for you to use. As a start you check out the below listed links:

  • wikipedia - Category:Text user interface libraries
  • ncurses FAQ - How big is it?
  • ncurses FAQ - What other programs are there?
like image 94
Filip Roséen - refp Avatar answered Feb 16 '23 05:02

Filip Roséen - refp