--- rxvt-unicode/src/urxvt.pm 2006/01/08 08:43:11 1.57 +++ rxvt-unicode/src/urxvt.pm 2006/01/09 00:34:36 1.59 @@ -60,9 +60,14 @@ =item option-popup (enabled by default) -Binds a popup menu to Ctrl-Button3 that lets you toggle (some) options at +Binds a popup menu to Ctrl-Button2 that lets you toggle (some) options at runtime. +=item selection-popup (enabled by default) + +Binds a popup menu to Ctrl-Button3 that lets you convert the selection +text into various other formats/action. + =item digital-clock Displays a digital clock using the built-in overlay. @@ -425,6 +430,9 @@ unless $msg =~ /\n$/; urxvt::warn ($msg); }; + + $ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/opt/sbin"; + delete $ENV{CDPATH}; } my @hook_count; @@ -467,14 +475,12 @@ open my $fh, "<:raw", $path or die "$path: $!"; - my $source = "package $pkg; use strict; use utf8;\n" + my $source = untaint "package $pkg; use strict; use utf8;\n" . "use base urxvt::term::proxy::;\n" . "#line 1 \"$path\"\n{\n" . (do { local $/; <$fh> }) . "\n};\n1"; - $source =~ /(.*)/s and $source = $1; # untaint - eval $source or die "$path: $@"; $pkg @@ -495,7 +501,7 @@ for (map { split /,/, $TERM->resource ("perl_ext_$_") } 1, 2) { if ($_ eq "default") { - $want_ext{$_}++ for qw(selection option-popup); + $want_ext{$_}++ for qw(selection option-popup selection-popup); } elsif (/^-(.*)$/) { delete $want_ext{$1}; } else { @@ -536,7 +542,10 @@ @_, ) and last; }; - warn $@ if $@;#d# + if ($@) { + $TERM->ungrab; # better to lose the grab than the session + warn $@; + } } } @@ -576,6 +585,10 @@ goto &$urxvt::term::proxy::AUTOLOAD; } +sub urxvt::term::proxy::DESTROY { + # nop +} + # urxvt::destroy_hook sub urxvt::destroy_hook::DESTROY { @@ -1159,8 +1172,8 @@ type => "button", text => " $text", value => $value, - render => sub { ($item->{value} ? "* " : " ") . $text }, - activate => sub { $cb->($item->{value} = !$item->{value}); }, + render => sub { ($_[0]{value} ? "* " : " ") . $text }, + activate => sub { $cb->($_[0]{value} = !$_[0]{value}); }, }; $self->add_item ($item); @@ -1180,6 +1193,7 @@ sub DESTROY { my ($self) = @_; + delete $self->{term}{_destroy}{$self}; $self->{term}->ungrab; } @@ -1293,11 +1307,11 @@ =over 4 -=item =0 - only fatal messages +=item == 0 - fatal messages -=item =3 - script loading and management +=item >= 3 - script loading and management -=item =10 - all events received +=item >=10 - all events received =back