ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/urxvt.pm
(Generate patch)

Comparing rxvt-unicode/src/urxvt.pm (file contents):
Revision 1.257 by root, Thu Jul 13 10:31:27 2017 UTC vs.
Revision 1.264 by root, Sat Jul 24 09:42:15 2021 UTC

4 4
5urxvtperl - rxvt-unicode's embedded perl interpreter 5urxvtperl - rxvt-unicode's embedded perl interpreter
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 # create a file grab_test in $HOME: 9 # create a file grab_test in some directory:
10 10
11 sub on_sel_grab { 11 sub on_sel_grab {
12 warn "you selected ", $_[0]->selection; 12 warn "you selected ", $_[0]->selection;
13 () 13 ()
14 } 14 }
15 15
16 # start a urxvt using it: 16 # start a urxvt instance using it:
17 17
18 urxvt --perl-lib $HOME -pe grab_test 18 urxvt --perl-lib path/to/somedirectory -pe grab_test
19 19
20=head1 DESCRIPTION 20=head1 DESCRIPTION
21 21
22Every time a terminal object gets created, extension scripts specified via 22Every time a terminal object gets created, extension scripts specified via
23the C<perl> resource are loaded and associated with it. 23the C<perl> resource are loaded and associated with it.
115the C<urxvt::extension> section below. 115the C<urxvt::extension> section below.
116 116
117=head2 META comments 117=head2 META comments
118 118
119Rxvt-unicode recognizes special meta comments in extensions that define 119Rxvt-unicode recognizes special meta comments in extensions that define
120different types of metadata. 120different types of metadata. These comments are scanned whenever a
121terminal is created and are typically used to autoload extensions when
122their resources or command line parameters are used.
121 123
122Currently, it recognises only one such comment: 124Currently, it recognises only one such comment:
123 125
124=over 4 126=over 4
125 127
126=item #:META:RESOURCE:name:type:desc 128=item #:META:RESOURCE:name:type:desc
127 129
128The RESOURCE comment defines a resource used by the extension, where 130The RESOURCE comment defines a resource used by the extension, where
129C<name> is the resource name, C<type> is the resource type, C<boolean> 131C<name> is the resource name, C<type> is the resource type, C<boolean>
130or C<string>, and C<desc> is the resource description. 132or C<string>, and C<desc> is the resource description.
133
134The extension will be autoloaded when this resource is specified or used
135as a command line parameter.
131 136
132=back 137=back
133 138
134=head2 Hooks 139=head2 Hooks
135 140
518PrivMode_Screen, PrivMode_Autowrap, PrivMode_aplCUR, PrivMode_aplKP, 523PrivMode_Screen, PrivMode_Autowrap, PrivMode_aplCUR, PrivMode_aplKP,
519PrivMode_HaveBackSpace, PrivMode_BackSpace, PrivMode_ShiftKeys, 524PrivMode_HaveBackSpace, PrivMode_BackSpace, PrivMode_ShiftKeys,
520PrivMode_VisibleCursor, PrivMode_MouseX10, PrivMode_MouseX11, 525PrivMode_VisibleCursor, PrivMode_MouseX10, PrivMode_MouseX11,
521PrivMode_scrollBar, PrivMode_TtyOutputInh, PrivMode_Keypress, 526PrivMode_scrollBar, PrivMode_TtyOutputInh, PrivMode_Keypress,
522PrivMode_smoothScroll, PrivMode_vt52, PrivMode_LFNL, PrivMode_MouseBtnEvent, 527PrivMode_smoothScroll, PrivMode_vt52, PrivMode_LFNL, PrivMode_MouseBtnEvent,
523PrivMode_MouseAnyEvent, PrivMode_BracketPaste, PrivMode_ExtModeMouse, 528PrivMode_MouseAnyEvent, PrivMode_BracketPaste, PrivMode_ExtMouseUTF8,
524PrivMode_ExtMouseRight, PrivMode_BlinkingCursor, PrivMode_mouse_report, 529PrivMode_ExtMouseUrxvt, PrivMode_BlinkingCursor, PrivMode_mouse_report,
525PrivMode_Default 530PrivMode_Default
526 531
527Constants for checking DEC private modes. 532Constants for checking DEC private modes.
528 533
529=back 534=back
600sub parse_resource { 605sub parse_resource {
601 my ($term, $name, $isarg, $longopt, $flag, $value) = @_; 606 my ($term, $name, $isarg, $longopt, $flag, $value) = @_;
602 607
603 $term->scan_extensions; 608 $term->scan_extensions;
604 609
610 # iterating over all resources has quadratic time overhead
611 # overall, maybe this could be optimised?
605 my $r = $term->{meta}{resource}; 612 my $r = $term->{meta}{resource};
606 keys %$r; # reset iterator 613 keys %$r; # reset iterator
607 while (my ($k, $v) = each %$r) { 614 while (my ($k, $v) = each %$r) {
608 my $pattern = $k; 615 my $pattern = $k;
609 $pattern =~ y/./-/ if $isarg; 616 $pattern =~ y/./-/ if $isarg;
722 @TERM_EXT = (); 729 @TERM_EXT = ();
723 $TERM->register_package ($_) for @pkg; 730 $TERM->register_package ($_) for @pkg;
724 } 731 }
725 732
726 for ( 733 for (
734 @{ delete $TERM->{perl_ext_3} },
727 (grep $_, map { split /,/, $TERM->resource ("perl_ext_$_") } 1, 2), 735 (grep $_, map { split /,/, $TERM->resource ("perl_ext_$_") } 1, 2),
728 @{ delete $TERM->{perl_ext_3} }
729 ) { 736 ) {
730 if ($_ eq "default") { 737 if ($_ eq "default") {
731 738
732 $ext_arg{$_} = [] 739 $ext_arg{$_} = []
733 for qw(selection option-popup selection-popup readline searchable-scrollback); 740 for qw(selection option-popup selection-popup readline searchable-scrollback confirm-paste);
734 741
735 for ($TERM->_keysym_resources) { 742 for ($TERM->_keysym_resources) {
736 next if /^(?:string|command|builtin|builtin-string|perl)/; 743 next if /^(?:string|command|builtin|builtin-string|perl)/;
737 next unless /^([A-Za-z0-9_\-]+):/; 744 next unless /^([A-Za-z0-9_\-]+):/;
738 745
1277 insecure intensityStyles iso14755 iso14755_52 jumpScroll loginShell 1284 insecure intensityStyles iso14755 iso14755_52 jumpScroll loginShell
1278 mapAlert meta8 mouseWheelScrollPage override_redirect pastableTabs 1285 mapAlert meta8 mouseWheelScrollPage override_redirect pastableTabs
1279 pointerBlank reverseVideo scrollBar scrollBar_floating scrollBar_right 1286 pointerBlank reverseVideo scrollBar scrollBar_floating scrollBar_right
1280 scrollTtyKeypress scrollTtyOutput scrollWithBuffer secondaryScreen 1287 scrollTtyKeypress scrollTtyOutput scrollWithBuffer secondaryScreen
1281 secondaryScroll skipBuiltinGlyphs skipScroll transparent tripleclickwords 1288 secondaryScroll skipBuiltinGlyphs skipScroll transparent tripleclickwords
1282 urgentOnBell utmpInhibit visualBell 1289 urgentOnBell utmpInhibit visualBell disablePasteBrackets
1283 1290
1284=item $value = $term->resource ($name[, $newval]) 1291=item $value = $term->resource ($name[, $newval])
1285 1292
1286Returns the current resource value associated with a given name and 1293Returns the current resource value associated with a given name and
1287optionally sets a new value. Setting values is most useful in the C<init> 1294optionally sets a new value. Setting values is most useful in the C<init>
1313 preeditType print_pipe pty_fd reverseVideo saveLines scrollBar 1320 preeditType print_pipe pty_fd reverseVideo saveLines scrollBar
1314 scrollBar_align scrollBar_floating scrollBar_right scrollBar_thickness 1321 scrollBar_align scrollBar_floating scrollBar_right scrollBar_thickness
1315 scrollTtyKeypress scrollTtyOutput scrollWithBuffer scrollstyle 1322 scrollTtyKeypress scrollTtyOutput scrollWithBuffer scrollstyle
1316 secondaryScreen secondaryScroll shade skipBuiltinGlyphs skipScroll 1323 secondaryScreen secondaryScroll shade skipBuiltinGlyphs skipScroll
1317 term_name title transient_for transparent tripleclickwords urgentOnBell 1324 term_name title transient_for transparent tripleclickwords urgentOnBell
1318 utmpInhibit visualBell 1325 utmpInhibit visualBell rewrapMode disablePasteBrackets
1319 1326
1320=cut 1327=cut
1321 1328
1322sub resource($$;$) { 1329sub resource($$;$) {
1323 my ($self, $name) = (shift, shift); 1330 my ($self, $name) = (shift, shift);
1715 # mouse reporting is turned on 1722 # mouse reporting is turned on
1716 } 1723 }
1717 1724
1718=item $view_start = $term->view_start ([$newvalue]) 1725=item $view_start = $term->view_start ([$newvalue])
1719 1726
1720Returns the row number of the topmost displayed line. Maximum value is 1727Returns the row number of the topmost displayed line and changes it,
1721C<0>, which displays the normal terminal contents. Lower values scroll 1728if an argument is given. Values greater than or equal to C<0> display
1722this many lines into the scrollback buffer. 1729the terminal contents. Lower values scroll this many lines into the
1730scrollback buffer.
1723 1731
1724=item $term->want_refresh 1732=item $term->want_refresh
1725 1733
1726Requests a screen refresh. At the next opportunity, rxvt-unicode will 1734Requests a screen refresh. At the next opportunity, rxvt-unicode will
1727compare the on-screen display with its stored representation. If they 1735compare the on-screen display with its stored representation. If they

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines