… | |
… | |
419 | use IO::Pty; |
419 | use IO::Pty; |
420 | use Fcntl; |
420 | use Fcntl; |
421 | |
421 | |
422 | my $pty = new IO::Pty; |
422 | my $pty = new IO::Pty; |
423 | fcntl $pty, F_SETFD, 0; # clear close-on-exec |
423 | fcntl $pty, F_SETFD, 0; # clear close-on-exec |
424 | |
|
|
425 | system "@@RXVT_NAME@@ -pty-fd " . (fileno $pty) . "&"; |
424 | system "@@RXVT_NAME@@ -pty-fd " . (fileno $pty) . "&"; |
|
|
425 | close $pty; |
426 | |
426 | |
427 | # now communicate with rxvt |
427 | # now communicate with rxvt |
428 | my $slave = $pty->slave; |
428 | my $slave = $pty->slave; |
429 | while (<$slave>) { print $slave "got <$_>\n" } |
429 | while (<$slave>) { print $slave "got <$_>\n" } |
430 | |
430 | |