How curses preserves screen contents?
问题 When you start the (n)curses program, it will remove the scroll bar from your terminal emulator, clear the screen, the scroll log (history) will also disappear. When you exit the program, the screen contents reappears, the scroll bar returns, and the scroll buffer returns. How ncurses does it? I have studied all ANSI escape codes, I cannot see anything that can do such things. What is the technology behind this? 回答1: This is discussed at length in the xterm FAQ Why doesn't the screen clear