On Sat, Jun 18, 2022 at 09:03:27AM -0400, Greg Reagle wrote:
> OMG I wish I had known this YEARS ago.  I can redirect the standard error of 
> a program to a different terminal!  I am using X11 and dwm and st on Debian.  
> For example:
> 
> ls --foobar 2> /dev/pts/0
> 
> I am excited by the possibilities and mad at myself for not having thought of 
> doing this before.
> 
> When I am debugging a terminal program that use the whole screen (like a text 
> editor running ncurses) it doesn't really work to have stderr information 
> mixed in with the TUI.  Problem solved!  I can print debugging information to 
> stderr.  Or it would help with debugging something like dvtm.
> 
> Now that I think about it, redirecting stderr to a log file and looking at 
> the log file with tail -f in another terminal would also achieve similar 
> goal, I guess.
> 

You can also do:

        dprintf(9, "something\n");

And do:

        ./program 9>topsecret_debug_log

#mindblown

-- 
Kind regards,
Hiltjo

Reply via email to