How would I 'attach' a
console/terminal-view to an
applications output so I can see what
it may be saying?
About this question, I know it is possible to catch the output, even when you didn't launch sceen command before launching the processus.
While I never tried it, I've found an interesting article which explains how to do using GDB (and without restarting your process).
redirecting-output-from-a-running-process
Basically:
- Check the open files list for your process, thanks to /proc/xxx/fd
- Attach your process with GDB
- While it is paused, close the file you are interested in, calling close() function (you can any function of your process in GDB. I suspect you need debug symbols in your process..)
- Open the a new file calling the create() or open() function. (Have a look in comments at the end, you'll see people suggest to use dup2() to ensure the same handle will be in use)
- Detach the process and let in run.
By the way, if you are running a linux OS on i386 box, comments are talking about a better tool to redirect output to a new console : 'retty' . If so, consider its use.