I would like a solution that allows me to detach a ncurses app to a different terminal emulator window and view the output of standard commands like 'cout' in the current one - for debugging and such.
I've seen a lot of solutions that write to a file and use tail but that seems quite hacky and slow. BTW. I have no idea where to even begin, I'm quite new with ncurses.
You can initialize curses in one of two ways:
using initscr (which uses the standard input/output), or
using newterm (which lets you specify which input/output to use)
For example, the ncurses test-program ditto uses newterm to open output displays on one or more xterm's. Here is a screenshot:

In principle, you could use the current terminal for input, and display ncurses output on another terminal (though offhand, I don't recall any useful programs which do this — only demos).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With