=head3 C This function provides the C function for X windows. If a program running under the debugger forks, a new window is opened and the subsidiary debugger is directed there. The C call is of particular note here. We have the new C we're spawning route file number 3 to STDOUT, and then execute the C command (which prints the device name of the TTY we'll want to use for input and output to STDOUT, then C for a very long time, routing this output to file number 3. This way we can simply read from the filehandle (which is STDOUT from the I we ran) to get the TTY we want to use. Only works if C is in your path and C<$ENV{DISPLAY}>, etc. are properly set up. =cut sub xterm_get_fork_TTY { ( my $name = $0 ) =~ s,^.*[/\\],,s; open XT, qq[3>&1 xterm -title "Daughter Perl debugger $pids $name" -e sh -c 'tty 1>&3;\ sleep 10000000' |]; # Get the output from 'tty' and clean it up a little. my $tty = ; chomp $tty;