How Do ncurses et. al. Work?

后端 未结 2 1391
广开言路
广开言路 2020-12-09 16:41

There are several libraries like ncurses that assist in making command-line GUIs.

Simply put, how do they work?

My first thought was that ncurses intercepts

2条回答
  •  -上瘾入骨i
    2020-12-09 17:21

    curses (and ncurses, too, I think) works by moving the cursor around on the screen. There are control sequences to do such things. Take a look at the code again and you'll see them. These sequences are not ASCII control characters, they are strings starting with (umm...) ESC, maybe. Have a look here for a higher-level explanation.

提交回复
热议问题