make getpeername() return the original socket address which before it was intercepted
[hband-tools.git] / urxvt-extensions / perl / queryinfo-osc
blob835fb3c69a7998d2ebc58f2935b1f7fbb0f2d372
1 #! perl
3 use constant {RXVT_CAPTURE=>1, RXVT_PASS=>(),};
5 sub on_osc_seq_perl
7         my ($rxvt, $osc, $resp) = @_;
8         
9         if(my ($query) = ($osc =~ /^queryinfo;([^;]+)/))
10         {
11                 if ($query eq "DISPLAY")
12                 {
13                         $rxvt->tt_write($rxvt->display_id . "\n");
14                         return RXVT_CAPTURE;
15                 }
16                 elsif ($query eq "DBUS_SESSION_BUS_ADDRESS")
17                 {
18                         $rxvt->tt_write($ENV{$query} . "\n");
19                         return RXVT_CAPTURE;
20                 }
21         }
22         return RXVT_PASS;