What libraries are needed for graphics like vim or

2019-04-27 07:54发布

问题:

What library is used to make a static terminal window like vim, nano, irssi or aptitude as opposed to a scrolling terminal?

I'm using C, but I'd be interested in libraries for other languages (for example, a C++ specific library).

回答1:

I believe the library you are looking for is Curses (or NCurses). There is also PDCurses for cross-platform (includind Win32) development.

I also remember the days of Conio on DOS based systems.



回答2:

Curses like library are usually used for that. pdcurses for windows, most *nixes come with a native version, or e.g. ncurses



回答3:

That would be ncurses.



回答4:

You can also use the termcap library (curses provides this) to lookup the terminal control strings for the terminal you're connected to, and send them yourself to implement whatever you like. Or, if you don't mind requiring a modern terminal that supports at least a common subset of the ANSI/ECMA standard, you can simply hard-code the standard terminal escapes.



标签: c graphics