… | |
… | |
85 | Displays a digital clock using the built-in overlay. |
85 | Displays a digital clock using the built-in overlay. |
86 | |
86 | |
87 | =item mark-urls |
87 | =item mark-urls |
88 | |
88 | |
89 | Uses per-line display filtering (C<on_line_update>) to underline urls and |
89 | Uses per-line display filtering (C<on_line_update>) to underline urls and |
90 | make them clickable. When clicked, the program specified in the resource |
90 | make them clickable. When middle-clicked, the program specified in the |
91 | C<urlLauncher> (default C<x-www-browser>) will be started. |
91 | resource C<urlLauncher> (default C<x-www-browser>) will be started. |
92 | |
92 | |
93 | =item block-graphics-to-ascii |
93 | =item block-graphics-to-ascii |
94 | |
94 | |
95 | A not very useful example of filtering all text output to the terminal, |
95 | A not very useful example of filtering all text output to the terminal, |
96 | by replacing all line-drawing characters (U+2500 .. U+259F) by a |
96 | by replacing all line-drawing characters (U+2500 .. U+259F) by a |
… | |
… | |
230 | =item on_sel_extend $term |
230 | =item on_sel_extend $term |
231 | |
231 | |
232 | Called whenever the user tries to extend the selection (e.g. with a double |
232 | Called whenever the user tries to extend the selection (e.g. with a double |
233 | click) and is either supposed to return false (normal operation), or |
233 | click) and is either supposed to return false (normal operation), or |
234 | should extend the selection itelf and return true to suppress the built-in |
234 | should extend the selection itelf and return true to suppress the built-in |
235 | processing. |
235 | processing. This can happen multiple times, as long as the callback |
|
|
236 | returns true, it will be called on every further click by the user and is |
|
|
237 | supposed to enlarge the selection more and more, if possible. |
236 | |
238 | |
237 | See the F<selection> example extension. |
239 | See the F<selection> example extension. |
238 | |
240 | |
239 | =item on_view_change $term, $offset |
241 | =item on_view_change $term, $offset |
240 | |
242 | |
… | |
… | |
496 | $msg .= "\n" |
498 | $msg .= "\n" |
497 | unless $msg =~ /\n$/; |
499 | unless $msg =~ /\n$/; |
498 | urxvt::warn ($msg); |
500 | urxvt::warn ($msg); |
499 | }; |
501 | }; |
500 | |
502 | |
|
|
503 | # %ENV is the original startup environment |
501 | delete $ENV{IFS}; |
504 | delete $ENV{IFS}; |
502 | delete $ENV{CDPATH}; |
505 | delete $ENV{CDPATH}; |
503 | delete $ENV{BASH_ENV}; |
506 | delete $ENV{BASH_ENV}; |
504 | $ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/opt/sbin"; |
507 | $ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/opt/sbin"; |
505 | } |
508 | } |
… | |
… | |
594 | if ($@) { |
597 | if ($@) { |
595 | $TERM->ungrab; # better to lose the grab than the session |
598 | $TERM->ungrab; # better to lose the grab than the session |
596 | warn $@; |
599 | warn $@; |
597 | } |
600 | } |
598 | } |
601 | } |
|
|
602 | |
|
|
603 | verbose 11, "$HOOKNAME[$htype] returning <$retval>" |
|
|
604 | if $verbosity >= 11; |
599 | } |
605 | } |
600 | |
606 | |
601 | if ($htype == 1) { # DESTROY |
607 | if ($htype == 1) { # DESTROY |
602 | if (my $hook = delete $TERM->{_hook}) { |
608 | if (my $hook = delete $TERM->{_hook}) { |
603 | for my $htype (0..$#$hook) { |
609 | for my $htype (0..$#$hook) { |
… | |
… | |
612 | # clear package |
618 | # clear package |
613 | %$TERM = (); |
619 | %$TERM = (); |
614 | } |
620 | } |
615 | |
621 | |
616 | $retval |
622 | $retval |
|
|
623 | } |
|
|
624 | |
|
|
625 | sub exec_async(@) { |
|
|
626 | my $pid = fork; |
|
|
627 | |
|
|
628 | return |
|
|
629 | if !defined $pid or $pid; |
|
|
630 | |
|
|
631 | %ENV = %{ $TERM->env }; |
|
|
632 | |
|
|
633 | exec @_; |
|
|
634 | _exit 255; |
617 | } |
635 | } |
618 | |
636 | |
619 | # urxvt::term::extension |
637 | # urxvt::term::extension |
620 | |
638 | |
621 | package urxvt::term::extension; |
639 | package urxvt::term::extension; |
… | |
… | |
1205 | Return the row number of the first/last row of the line, respectively. |
1223 | Return the row number of the first/last row of the line, respectively. |
1206 | |
1224 | |
1207 | =item $offset = $line->offset_of ($row, $col) |
1225 | =item $offset = $line->offset_of ($row, $col) |
1208 | |
1226 | |
1209 | Returns the character offset of the given row|col pair within the logical |
1227 | Returns the character offset of the given row|col pair within the logical |
1210 | line. |
1228 | line. Works for rows outside the line, too, and returns corresponding |
|
|
1229 | offsets outside the string. |
1211 | |
1230 | |
1212 | =item ($row, $col) = $line->coord_of ($offset) |
1231 | =item ($row, $col) = $line->coord_of ($offset) |
1213 | |
1232 | |
1214 | Translates a string offset into terminal coordinates again. |
1233 | Translates a string offset into terminal coordinates again. |
1215 | |
1234 | |
… | |
… | |
1570 | |
1589 | |
1571 | =item == 0 - fatal messages |
1590 | =item == 0 - fatal messages |
1572 | |
1591 | |
1573 | =item >= 3 - script loading and management |
1592 | =item >= 3 - script loading and management |
1574 | |
1593 | |
1575 | =item >=10 - all events received |
1594 | =item >=10 - all called hooks |
|
|
1595 | |
|
|
1596 | =item >=11 - hook reutrn values |
1576 | |
1597 | |
1577 | =back |
1598 | =back |
1578 | |
1599 | |
1579 | =head1 AUTHOR |
1600 | =head1 AUTHOR |
1580 | |
1601 | |