… | |
… | |
58 | |
58 | |
59 | =back |
59 | =back |
60 | |
60 | |
61 | =item option-popup (enabled by default) |
61 | =item option-popup (enabled by default) |
62 | |
62 | |
63 | Binds a popup menu to Ctrl-Button3 that lets you toggle (some) options at |
63 | Binds a popup menu to Ctrl-Button2 that lets you toggle (some) options at |
64 | runtime. |
64 | runtime. |
|
|
65 | |
|
|
66 | =item selection-popup (enabled by default) |
|
|
67 | |
|
|
68 | Binds a popup menu to Ctrl-Button3 that lets you convert the selection |
|
|
69 | text into various other formats/action. |
65 | |
70 | |
66 | =item digital-clock |
71 | =item digital-clock |
67 | |
72 | |
68 | Displays a digital clock using the built-in overlay. |
73 | Displays a digital clock using the built-in overlay. |
69 | |
74 | |
… | |
… | |
423 | my $msg = join "", @_; |
428 | my $msg = join "", @_; |
424 | $msg .= "\n" |
429 | $msg .= "\n" |
425 | unless $msg =~ /\n$/; |
430 | unless $msg =~ /\n$/; |
426 | urxvt::warn ($msg); |
431 | urxvt::warn ($msg); |
427 | }; |
432 | }; |
|
|
433 | |
|
|
434 | delete $ENV{IFS}; |
|
|
435 | delete $ENV{CDPATH}; |
|
|
436 | delete $ENV{BASH_ENV}; |
|
|
437 | $ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/opt/sbin"; |
428 | } |
438 | } |
429 | |
439 | |
430 | my @hook_count; |
440 | my @hook_count; |
431 | my $verbosity = $ENV{URXVT_PERL_VERBOSITY}; |
441 | my $verbosity = $ENV{URXVT_PERL_VERBOSITY}; |
432 | |
442 | |
… | |
… | |
465 | verbose 3, "loading extension '$path' into package '$pkg'"; |
475 | verbose 3, "loading extension '$path' into package '$pkg'"; |
466 | |
476 | |
467 | open my $fh, "<:raw", $path |
477 | open my $fh, "<:raw", $path |
468 | or die "$path: $!"; |
478 | or die "$path: $!"; |
469 | |
479 | |
470 | my $source = "package $pkg; use strict; use utf8;\n" |
480 | my $source = untaint "package $pkg; use strict; use utf8;\n" |
471 | . "use base urxvt::term::proxy::;\n" |
481 | . "use base urxvt::term::proxy::;\n" |
472 | . "#line 1 \"$path\"\n{\n" |
482 | . "#line 1 \"$path\"\n{\n" |
473 | . (do { local $/; <$fh> }) |
483 | . (do { local $/; <$fh> }) |
474 | . "\n};\n1"; |
484 | . "\n};\n1"; |
475 | |
485 | |
… | |
… | |
491 | |
501 | |
492 | my %want_ext; |
502 | my %want_ext; |
493 | |
503 | |
494 | for (map { split /,/, $TERM->resource ("perl_ext_$_") } 1, 2) { |
504 | for (map { split /,/, $TERM->resource ("perl_ext_$_") } 1, 2) { |
495 | if ($_ eq "default") { |
505 | if ($_ eq "default") { |
496 | $want_ext{$_}++ for qw(selection option-popup); |
506 | $want_ext{$_}++ for qw(selection option-popup selection-popup); |
497 | } elsif (/^-(.*)$/) { |
507 | } elsif (/^-(.*)$/) { |
498 | delete $want_ext{$1}; |
508 | delete $want_ext{$1}; |
499 | } else { |
509 | } else { |
500 | $want_ext{$_}++; |
510 | $want_ext{$_}++; |
501 | } |
511 | } |
… | |
… | |
532 | $proxy |
542 | $proxy |
533 | }, |
543 | }, |
534 | @_, |
544 | @_, |
535 | ) and last; |
545 | ) and last; |
536 | }; |
546 | }; |
537 | warn $@ if $@;#d# |
547 | if ($@) { |
|
|
548 | $TERM->ungrab; # better to lose the grab than the session |
|
|
549 | warn $@; |
|
|
550 | } |
538 | } |
551 | } |
539 | } |
552 | } |
540 | |
553 | |
541 | if ($htype == 1) { # DESTROY |
554 | if ($htype == 1) { # DESTROY |
542 | # remove hooks if unused |
555 | # remove hooks if unused |
… | |
… | |
570 | } |
583 | } |
571 | 1 |
584 | 1 |
572 | } or die "FATAL: unable to compile method forwarder: $@"; |
585 | } or die "FATAL: unable to compile method forwarder: $@"; |
573 | |
586 | |
574 | goto &$urxvt::term::proxy::AUTOLOAD; |
587 | goto &$urxvt::term::proxy::AUTOLOAD; |
|
|
588 | } |
|
|
589 | |
|
|
590 | sub urxvt::term::proxy::DESTROY { |
|
|
591 | # nop |
575 | } |
592 | } |
576 | |
593 | |
577 | # urxvt::destroy_hook |
594 | # urxvt::destroy_hook |
578 | |
595 | |
579 | sub urxvt::destroy_hook::DESTROY { |
596 | sub urxvt::destroy_hook::DESTROY { |
… | |
… | |
1155 | |
1172 | |
1156 | my $item; $item = { |
1173 | my $item; $item = { |
1157 | type => "button", |
1174 | type => "button", |
1158 | text => " $text", |
1175 | text => " $text", |
1159 | value => $value, |
1176 | value => $value, |
1160 | render => sub { ($item->{value} ? "* " : " ") . $text }, |
1177 | render => sub { ($_[0]{value} ? "* " : " ") . $text }, |
1161 | activate => sub { $cb->($item->{value} = !$item->{value}); }, |
1178 | activate => sub { $cb->($_[0]{value} = !$_[0]{value}); }, |
1162 | }; |
1179 | }; |
1163 | |
1180 | |
1164 | $self->add_item ($item); |
1181 | $self->add_item ($item); |
1165 | } |
1182 | } |
1166 | |
1183 | |
… | |
… | |
1176 | } |
1193 | } |
1177 | |
1194 | |
1178 | sub DESTROY { |
1195 | sub DESTROY { |
1179 | my ($self) = @_; |
1196 | my ($self) = @_; |
1180 | |
1197 | |
|
|
1198 | delete $self->{term}{_destroy}{$self}; |
1181 | $self->{term}->ungrab; |
1199 | $self->{term}->ungrab; |
1182 | } |
1200 | } |
1183 | |
1201 | |
1184 | =head2 The C<urxvt::timer> Class |
1202 | =head2 The C<urxvt::timer> Class |
1185 | |
1203 | |
… | |
… | |
1289 | This variable controls the verbosity level of the perl extension. Higher |
1307 | This variable controls the verbosity level of the perl extension. Higher |
1290 | numbers indicate more verbose output. |
1308 | numbers indicate more verbose output. |
1291 | |
1309 | |
1292 | =over 4 |
1310 | =over 4 |
1293 | |
1311 | |
1294 | =item =0 - only fatal messages |
1312 | =item == 0 - fatal messages |
1295 | |
1313 | |
1296 | =item =3 - script loading and management |
1314 | =item >= 3 - script loading and management |
1297 | |
1315 | |
1298 | =item =10 - all events received |
1316 | =item >=10 - all events received |
1299 | |
1317 | |
1300 | =back |
1318 | =back |
1301 | |
1319 | |
1302 | =head1 AUTHOR |
1320 | =head1 AUTHOR |
1303 | |
1321 | |