How to keep the terminal from scrolling

2019-08-31 07:31发布

I am writing a simple program in C++ to be run in a terminal window. I would like the output text to be locked in position on the screen. Instead of each new line appearing at the bottom of the screen and pushing everything up, I would like to be able to change a line of text or some characters in a line of text, while keeping other lines above and below it static. I know I have seen this done in terminal, and I believe it was done with C++, but I can't find any documentation on it. I cannot even think of what this type of display might be called. My google fu has failed me; please help. If you can tell me what commands/library to use, that would be great, but even being able to tell me what commands accomplish this in a programming language other than C++ would give me more to go on than I have now.

标签: c++ ncurses
2条回答
甜甜的少女心
2楼-- · 2019-08-31 08:06

You want ncurses, a library for displaying text on a terminal.

查看更多
来,给爷笑一个
3楼-- · 2019-08-31 08:09

If you are programming for Microsoft Windows, try googling for Win32 Console Functions.

查看更多
登录 后发表回答