Add support for copying to clipboard (based on patch by Dana Jansens).
[dana/urxvt.git] / doc / pty-fd
1 #!/usr/bin/perl
2
3 # sample script to illustrate the -pty-fd option
4
5 use IO::Pty;
6 use Fcntl;
7
8 my $pty = new IO::Pty;
9 fcntl $pty, F_SETFD, 0; # clear close-on-exec
10
11 system "rxvt -pty-fd " . (fileno $pty) . "&";
12 close $pty;
13
14 # now communicate with rxvt
15 my $slave = $pty->slave;
16
17 print $slave "hi! please enter something and press return (ctrl-d to exit):\n";
18
19 while (<$slave>) {
20    print $slave "you entered: $_";
21 }
22