… | |
… | |
84 | |
84 | |
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. |
89 | Uses per-line display filtering (C<on_line_update>) to underline urls and |
|
|
90 | make them clickable. When middle-clicked, the program specified in the |
|
|
91 | resource C<urlLauncher> (default C<x-www-browser>) will be started. |
90 | |
92 | |
91 | =item block-graphics-to-ascii |
93 | =item block-graphics-to-ascii |
92 | |
94 | |
93 | 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, |
94 | 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 |
… | |
… | |
228 | =item on_sel_extend $term |
230 | =item on_sel_extend $term |
229 | |
231 | |
230 | 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 |
231 | click) and is either supposed to return false (normal operation), or |
233 | click) and is either supposed to return false (normal operation), or |
232 | 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 |
233 | 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. |
234 | |
238 | |
235 | See the F<selection> example extension. |
239 | See the F<selection> example extension. |
236 | |
240 | |
237 | =item on_view_change $term, $offset |
241 | =item on_view_change $term, $offset |
238 | |
242 | |
… | |
… | |
494 | $msg .= "\n" |
498 | $msg .= "\n" |
495 | unless $msg =~ /\n$/; |
499 | unless $msg =~ /\n$/; |
496 | urxvt::warn ($msg); |
500 | urxvt::warn ($msg); |
497 | }; |
501 | }; |
498 | |
502 | |
|
|
503 | # %ENV is the original startup environment |
499 | delete $ENV{IFS}; |
504 | delete $ENV{IFS}; |
500 | delete $ENV{CDPATH}; |
505 | delete $ENV{CDPATH}; |
501 | delete $ENV{BASH_ENV}; |
506 | delete $ENV{BASH_ENV}; |
502 | $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"; |
503 | } |
508 | } |
… | |
… | |
592 | if ($@) { |
597 | if ($@) { |
593 | $TERM->ungrab; # better to lose the grab than the session |
598 | $TERM->ungrab; # better to lose the grab than the session |
594 | warn $@; |
599 | warn $@; |
595 | } |
600 | } |
596 | } |
601 | } |
|
|
602 | |
|
|
603 | verbose 11, "$HOOKNAME[$htype] returning <$retval>" |
|
|
604 | if $verbosity >= 11; |
597 | } |
605 | } |
598 | |
606 | |
599 | if ($htype == 1) { # DESTROY |
607 | if ($htype == 1) { # DESTROY |
600 | if (my $hook = delete $TERM->{_hook}) { |
608 | if (my $hook = delete $TERM->{_hook}) { |
601 | for my $htype (0..$#$hook) { |
609 | for my $htype (0..$#$hook) { |
… | |
… | |
610 | # clear package |
618 | # clear package |
611 | %$TERM = (); |
619 | %$TERM = (); |
612 | } |
620 | } |
613 | |
621 | |
614 | $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; |
615 | } |
635 | } |
616 | |
636 | |
617 | # urxvt::term::extension |
637 | # urxvt::term::extension |
618 | |
638 | |
619 | package urxvt::term::extension; |
639 | package urxvt::term::extension; |
… | |
… | |
860 | my ($self, $name) = (shift, shift); |
880 | my ($self, $name) = (shift, shift); |
861 | unshift @_, $self, $name, ($name =~ s/\s*\+\s*(\d+)$// ? $1 : 0); |
881 | unshift @_, $self, $name, ($name =~ s/\s*\+\s*(\d+)$// ? $1 : 0); |
862 | &urxvt::term::_resource |
882 | &urxvt::term::_resource |
863 | } |
883 | } |
864 | |
884 | |
|
|
885 | =item $value = $term->x_resource ($pattern) |
|
|
886 | |
|
|
887 | Returns the X-Resource for the given pattern, excluding the program or |
|
|
888 | class name, i.e. C<< $term->x_resource ("boldFont") >> should return the |
|
|
889 | same value as used by this instance of rxvt-unicode. Returns C<undef> if no |
|
|
890 | resource with that pattern exists. |
|
|
891 | |
|
|
892 | This method should only be called during the C<on_start> hook, as there is |
|
|
893 | only one resource database per display, and later invocations might return |
|
|
894 | the wrong resources. |
|
|
895 | |
865 | =item $success = $term->parse_keysym ($keysym_spec, $command_string) |
896 | =item $success = $term->parse_keysym ($keysym_spec, $command_string) |
866 | |
897 | |
867 | Adds a keymap translation exactly as specified via a resource. See the |
898 | Adds a keymap translation exactly as specified via a resource. See the |
868 | C<keysym> resource in the @@RXVT_NAME@@(1) manpage. |
899 | C<keysym> resource in the @@RXVT_NAME@@(1) manpage. |
869 | |
900 | |
… | |
… | |
884 | =item ($row, $col) = $term->selection_end ([$row, $col]) |
915 | =item ($row, $col) = $term->selection_end ([$row, $col]) |
885 | |
916 | |
886 | Return the current values of the selection mark, begin or end positions, |
917 | Return the current values of the selection mark, begin or end positions, |
887 | and optionally set them to new values. |
918 | and optionally set them to new values. |
888 | |
919 | |
|
|
920 | =item $term->selection_make ($eventtime[, $rectangular]) |
|
|
921 | |
|
|
922 | Tries to make a selection as set by C<selection_beg> and |
|
|
923 | C<selection_end>. If C<$rectangular> is true (default: false), a |
|
|
924 | rectangular selection will be made. This is the prefered function to make |
|
|
925 | a selection. |
|
|
926 | |
889 | =item $success = $term->selection_grab ($eventtime) |
927 | =item $success = $term->selection_grab ($eventtime) |
890 | |
928 | |
891 | Try to request the primary selection from the server (for example, as set |
929 | Try to request the primary selection text from the server (for example, as |
892 | by the next method). |
930 | set by the next method). No visual feedback will be given. This function |
|
|
931 | is mostly useful from within C<on_sel_grab> hooks. |
893 | |
932 | |
894 | =item $oldtext = $term->selection ([$newtext]) |
933 | =item $oldtext = $term->selection ([$newtext]) |
895 | |
934 | |
896 | Return the current selection text and optionally replace it by C<$newtext>. |
935 | Return the current selection text and optionally replace it by C<$newtext>. |
897 | |
936 | |
… | |
… | |
990 | Convert the given locale-encoded octets into a perl string. |
1029 | Convert the given locale-encoded octets into a perl string. |
991 | |
1030 | |
992 | =item $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle]) |
1031 | =item $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle]) |
993 | |
1032 | |
994 | XORs the rendition values in the given span with the provided value |
1033 | XORs the rendition values in the given span with the provided value |
995 | (default: C<RS_RVid>). Useful in refresh hooks to provide effects similar |
1034 | (default: C<RS_RVid>), which I<MUST NOT> contain font styles. Useful in |
996 | to the selection. |
1035 | refresh hooks to provide effects similar to the selection. |
997 | |
1036 | |
998 | =item $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, $rstyle2]]) |
1037 | =item $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, $rstyle2]]) |
999 | |
1038 | |
1000 | Similar to C<scr_xor_span>, but xors a rectangle instead. Trailing |
1039 | Similar to C<scr_xor_span>, but xors a rectangle instead. Trailing |
1001 | whitespace will additionally be xored with the C<$rstyle2>, which defaults |
1040 | whitespace will additionally be xored with the C<$rstyle2>, which defaults |
1002 | to C<RS_RVid | RS_Uline>, which removes reverse video again and underlines |
1041 | to C<RS_RVid | RS_Uline>, which removes reverse video again and underlines |
1003 | it instead. |
1042 | it instead. Both styles I<MUST NOT> contain font styles. |
1004 | |
1043 | |
1005 | =item $term->scr_bell |
1044 | =item $term->scr_bell |
1006 | |
1045 | |
1007 | Ring the bell! |
1046 | Ring the bell! |
1008 | |
1047 | |
… | |
… | |
1192 | Return the row number of the first/last row of the line, respectively. |
1231 | Return the row number of the first/last row of the line, respectively. |
1193 | |
1232 | |
1194 | =item $offset = $line->offset_of ($row, $col) |
1233 | =item $offset = $line->offset_of ($row, $col) |
1195 | |
1234 | |
1196 | Returns the character offset of the given row|col pair within the logical |
1235 | Returns the character offset of the given row|col pair within the logical |
1197 | line. |
1236 | line. Works for rows outside the line, too, and returns corresponding |
|
|
1237 | offsets outside the string. |
1198 | |
1238 | |
1199 | =item ($row, $col) = $line->coord_of ($offset) |
1239 | =item ($row, $col) = $line->coord_of ($offset) |
1200 | |
1240 | |
1201 | Translates a string offset into terminal coordinates again. |
1241 | Translates a string offset into terminal coordinates again. |
1202 | |
1242 | |
… | |
… | |
1557 | |
1597 | |
1558 | =item == 0 - fatal messages |
1598 | =item == 0 - fatal messages |
1559 | |
1599 | |
1560 | =item >= 3 - script loading and management |
1600 | =item >= 3 - script loading and management |
1561 | |
1601 | |
1562 | =item >=10 - all events received |
1602 | =item >=10 - all called hooks |
|
|
1603 | |
|
|
1604 | =item >=11 - hook reutrn values |
1563 | |
1605 | |
1564 | =back |
1606 | =back |
1565 | |
1607 | |
1566 | =head1 AUTHOR |
1608 | =head1 AUTHOR |
1567 | |
1609 | |