Don't be too envious. Linux kernel virtual terminals have "vcsa" devices that one can read for this sort of thing. And it's right there in the manual page how one does this.
They suffer from being straight copies of CGA, which has historically had a lot of conflation of boldness and brightness, as well as a very limited colour gamut that will make you weep at what your 256-colour TUI programs are reduced to. The NetBSD ioctl supposedly has a bold attribute in a separate field of the structure to a bright colour. Which in the backwards-thinking world of terminals where some people still have the CGA Think that bold=bright, is almost heresy. Still. In 2025. (-:
If you are looking for this sort of thing in a GUI/TUI terminal emulator that is a user application program, rather than the terminal emulators that are built into the NetBSD kernel or into Linux, then that's a different kettle of fish entirely. I know of one that provides a direct vcsa workalike. I wrote it.
GNU screen works by having a server maintaining a buffer, and a client that attaches to the server and then renders that buffer's contents onto the client's own terminal. So in theory one might be able to access the display of GNU screen in a similar manner by making something that pretends to be a client. But how much of this mechanism even operates when GNU screen is in serial terminal mode, I don't know off the top of my head.
The same goes for tmux, of course. And indeed mosh. Although the documentation of the actual protocol was a not-done to-do item, promised in the early publicity for mosh but never delivered, for years. I kept checking back for quite a while to see whether they'd documented it as promised.
There's at least one GUI terminal emulator that stores its scrollback area to file, but only the scrollback area. GUI terminal emulators generally do not expose this sort of thing, though. It's some complex private data structure in the emulator process's memory, usually.
All that said, wscons is a fairly good-looking API. Certainly better than the undocumented mess that is fbio.
* https://man7.org/linux/man-pages/man4/vcsa.4.html
They suffer from being straight copies of CGA, which has historically had a lot of conflation of boldness and brightness, as well as a very limited colour gamut that will make you weep at what your 256-colour TUI programs are reduced to. The NetBSD ioctl supposedly has a bold attribute in a separate field of the structure to a bright colour. Which in the backwards-thinking world of terminals where some people still have the CGA Think that bold=bright, is almost heresy. Still. In 2025. (-:
If you are looking for this sort of thing in a GUI/TUI terminal emulator that is a user application program, rather than the terminal emulators that are built into the NetBSD kernel or into Linux, then that's a different kettle of fish entirely. I know of one that provides a direct vcsa workalike. I wrote it.
* http://jdebp.info./Softwares/nosh/guide/commands/user-vt.xml
GNU screen works by having a server maintaining a buffer, and a client that attaches to the server and then renders that buffer's contents onto the client's own terminal. So in theory one might be able to access the display of GNU screen in a similar manner by making something that pretends to be a client. But how much of this mechanism even operates when GNU screen is in serial terminal mode, I don't know off the top of my head.
The same goes for tmux, of course. And indeed mosh. Although the documentation of the actual protocol was a not-done to-do item, promised in the early publicity for mosh but never delivered, for years. I kept checking back for quite a while to see whether they'd documented it as promised.
There's at least one GUI terminal emulator that stores its scrollback area to file, but only the scrollback area. GUI terminal emulators generally do not expose this sort of thing, though. It's some complex private data structure in the emulator process's memory, usually.
All that said, wscons is a fairly good-looking API. Certainly better than the undocumented mess that is fbio.