0

I'm developing a 6502 emulator in C and I want make a interface similar to the one of fzf, something like this:

enter image description here

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.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • fzf is open source, you can study its code. For SO, your question here is much too broad: It basically asks about a full how-to. This makes it not really suitable here. Also, nobody needs images of your desktop background, though I admit that an image is called for here. Maybe you could improve the question if you started with the last sentence, provided a [mcve] and continued from there? – Ulrich Eckhardt Apr 01 '23 at 08:24

1 Answers1

1

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.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105