Reputation: 53
I'm developing a 6502 emulator in C and I want make a interface similar to the one of fzf, something like this:
notice that the interface doesn't clear the entire screen. I want to make something brief like that but to dump the most important registers of the CPU, etc.
I've already tried with ncurses but it always clears the screen.
Upvotes: 0
Views: 192
Reputation: 54603
Applications which clear only part of the screen generally (except for hard-coded applications using escape-sequences) use the low-level terminfo or termcap interfaces to the terminal database. curses does have a special case (the filter function) which also is useful for this purpose.
The example shown in the screenshot uses hard-coded escapes (see source code), which could be improved, e.g., using one of the existing terminfo interfaces (such as xo or tcell).
All of those are aimed at very simple applications. Reading their source code is the best way to understand how they work.
Upvotes: 1