user16823964
user16823964

Reputation:

In Linux, are there any functions similar to CreateConsoleScreenBuffer/ReadConsoleOutput to read the terminal contents?

That is, how to create a new screen buffer and read/ write buffer contents in Linux? The screen buffer I am talking about refers to the content displayed to the user. Or the entire screen.

I don't want to use ncurses. I found terminfo, but I want a function instead of an command. Perhaps ioctl can read the buffer, but I don't know how to use it.

Upvotes: 1

Views: 343

Answers (1)

Dúthomhas
Dúthomhas

Reputation: 10048

No

It is given that the user program will maintain a buffer of all screen content it wishes to preserve.

This is actually how NCurses works: All output functions actually modify the WINDOW buffer, and wrefresh() causes that buffer to be flushed to the display, as needed.

The Microsoft roadmap for the Windows Terminal expects future TUI programs to do the same, since that is how it works in Linux, I guess.

Upvotes: 1

Related Questions