22
Everytime a terminal object gets created, extension scripts specified via
22
Every time a terminal object gets created, extension scripts specified via
23
23
the C<perl> resource are loaded and associated with it.
25
25
Scripts are compiled in a 'use strict' and 'use utf8' environment, and
65
65
The index number (0, 1...) must not have any holes, and each regex must
66
66
contain at least one pair of capturing parentheses, which will be used for
67
the match. For example, the followign adds a regex that matches everything
67
the match. For example, the following adds a regex that matches everything
68
68
between two vertical bars:
70
70
URxvt.selection.pattern-0: \\|([^|]+)\\|
124
124
popup is being displayed.
126
126
It's sole argument is the popup menu, which can be modified. The selection
127
is in C<$_>, which can be used to decide wether to add something or not.
127
is in C<$_>, which can be used to decide whether to add something or not.
128
128
It should either return nothing or a string and a code reference. The
129
129
string will be used as button text and the code reference will be called
130
130
when the button gets activated and should transform C<$_>.
153
153
additionally stores the first match in the current line into the primary
156
The regex defaults to "(?i)", resulting in a case-insensitive search. To
157
get a case-sensitive search you can delete this prefix using C<BackSpace>
158
or simply use an uppercase character which removes the "(?i)" prefix.
160
See L<perlre> for more info about perl regular expression syntax.
156
162
=item readline (enabled by default)
158
164
A support package that tries to make editing with readline easier. At
218
224
This transforms the terminal into a tabbar with additional terminals, that
219
is, it implements what is commonly refered to as "tabbed terminal". The topmost line
225
is, it implements what is commonly referred to as "tabbed terminal". The topmost line
220
226
displays a "[NEW]" button, which, when clicked, will add a new tab, followed by one
256
262
@@RXVT_NAME@@ -pt OnTheSpot -pe xim-onthespot
266
A very primitive quake-console-like extension. It was inspired by a
267
description of how the programs C<kuake> and C<yakuake> work: Whenever the
268
user presses a global accelerator key (by default C<F10>), the terminal
269
will show or hide itself. Another press of the accelerator key will hide
272
Initially, the window will not be shown when using this extension.
274
This is useful if you need a single terminal thats not using any desktop
275
space most of the time but is quickly available at the press of a key.
277
The accelerator key is grabbed regardless of any modifiers, so this
278
extension will actually grab a physical key just for this function.
280
If you want a quake-like animation, tell your window manager to do so
258
283
=item automove-background
260
This is basically a one-line extension that dynamically changes the background pixmap offset
261
to the window position, in effect creating the same effect as pseudo transparency with
262
a custom pixmap. No scaling is supported in this mode. Exmaple:
285
This is basically a very small extension that dynamically changes the
286
background pixmap offset to the window position, in effect creating the
287
same effect as pseudo transparency with a custom pixmap. No scaling is
288
supported in this mode. Example:
264
290
@@RXVT_NAME@@ -pixmap background.xpm -pe automove-background
266
292
=item block-graphics-to-ascii
268
A not very useful example of filtering all text output to the terminal,
294
A not very useful example of filtering all text output to the terminal
269
295
by replacing all line-drawing characters (U+2500 .. U+259F) by a
270
296
similar-looking ascii character.
371
397
=head2 Extension Objects
373
Very perl extension is a perl class. A separate perl object is created
399
Every perl extension is a perl class. A separate perl object is created
374
400
for each terminal and each extension and passed as the first parameter to
375
401
hooks. So extensions can use their C<$self> object without having to think
376
402
about other extensions, with the exception of methods and members that
406
432
The following subroutines can be declared in extension files, and will be
407
433
called whenever the relevant event happens.
409
The first argument passed to them is an extension oject as described in
435
The first argument passed to them is an extension object as described in
410
436
the in the C<Extension Objects> section.
412
438
B<All> of these hooks must return a boolean value. If any of the called
466
492
requested from the server. The selection text can be queried and changed
467
493
by calling C<< $term->selection >>.
469
Returning a true value aborts selection grabbing. It will still be hilighted.
495
Returning a true value aborts selection grabbing. It will still be highlighted.
471
497
=item on_sel_extend $term
473
499
Called whenever the user tries to extend the selection (e.g. with a double
474
500
click) and is either supposed to return false (normal operation), or
475
should extend the selection itelf and return true to suppress the built-in
501
should extend the selection itself and return true to suppress the built-in
476
502
processing. This can happen multiple times, as long as the callback
477
503
returns true, it will be called on every further click by the user and is
478
504
supposed to enlarge the selection more and more, if possible.
482
508
=item on_view_change $term, $offset
484
Called whenever the view offset changes, i..e the user or program
510
Called whenever the view offset changes, i.e. the user or program
485
511
scrolls. Offset C<0> means display the normal terminal, positive values
486
512
show this many lines of scrollback.
495
521
$nrow - 1) represent the lines to be scrolled out). C<$saved> is the total
496
522
number of lines that will be in the scrollback buffer.
498
=item on_osc_seq $term, $string
524
=item on_osc_seq $term, $op, $args
526
Called on every OSC sequence and can be used to suppress it or modify its
527
behaviour. The default should be to return an empty list. A true value
528
suppresses execution of the request completely. Make sure you don't get
529
confused by recursive invocations when you output an osc sequence within
532
C<on_osc_seq_perl> should be used for new behaviour.
534
=item on_osc_seq_perl $term, $string
500
536
Called whenever the B<ESC ] 777 ; string ST> command sequence (OSC =
501
537
operating system command) is processed. Cursor position and other state
507
543
Be careful not ever to trust (in a security sense) the data you receive,
508
as its source can not easily be controleld (e-mail content, messages from
544
as its source can not easily be controlled (e-mail content, messages from
509
545
other users on the same system etc.).
511
547
=item on_add_lines $term, $string
549
585
=item on_user_command $term, $string
551
Called whenever the a user-configured event is being activated (e.g. via
587
Called whenever a user-configured event is being activated (e.g. via
552
588
a C<perl:string> action bound to a key, see description of the B<keysym>
553
589
resource in the @@RXVT_NAME@@(1) manpage).
558
594
=item on_resize_all_windows $tern, $new_width, $new_height
560
Called just after the new window size has been calculcated, but before
596
Called just after the new window size has been calculated, but before
561
597
windows are actually being resized or hints are being set. If this hook
562
598
returns TRUE, setting of the window hints is being skipped.
567
603
windows). Should only be used as a last resort. Most event structure
568
604
members are not passed.
606
=item on_root_event $term, $event
608
Like C<on_x_event>, but is called for events on the root window.
570
610
=item on_focus_in $term
572
612
Called whenever the window gets the keyboard focus, before rxvt-unicode
575
615
=item on_focus_out $term
577
Called wheneever the window loses keyboard focus, before rxvt-unicode does
617
Called whenever the window loses keyboard focus, before rxvt-unicode does
578
618
focus out processing.
580
620
=item on_configure_notify $term, $event
668
708
=item @urxvt::TERM_INIT
670
All coderefs in this array will be called as methods of the next newly
710
All code references in this array will be called as methods of the next newly
671
711
created C<urxvt::term> object (during the C<on_init> phase). The array
672
gets cleared before the codereferences that were in it are being executed,
673
so coderefs can push themselves onto it again if they so desire.
712
gets cleared before the code references that were in it are being executed,
713
so references can push themselves onto it again if they so desire.
675
This complements to the perl-eval commandline option, but gets executed
715
This complements to the perl-eval command line option, but gets executed
678
718
=item @urxvt::TERM_EXT
707
747
=item @terms = urxvt::termlist
709
749
Returns all urxvt::term objects that exist in this process, regardless of
710
wether they are started, being destroyed etc., so be careful. Only term
750
whether they are started, being destroyed etc., so be careful. Only term
711
751
objects that have perl extensions attached will be returned (because there
712
752
is no urxvt::term objet associated with others).
899
939
verbose 10, "$HOOKNAME[$htype] (" . (join ", ", $TERM, @_) . ")"
900
940
if $verbosity >= 10;
904
while (my ($pkg, $cb) = each %$cb) {
905
my $retval_ = eval { $cb->($TERM->{_pkg}{$pkg}, @_) };
942
for my $pkg (keys %$cb) {
943
my $retval_ = eval { $cb->{$pkg}->($TERM->{_pkg}{$pkg}, @_) };
906
944
$retval ||= $retval_;
1157
1195
optionally change it. All option values are stored by name in the hash
1158
1196
C<%urxvt::OPTION>. Options not enabled in this binary are not in the hash.
1160
Here is a a likely non-exhaustive list of option names, please see the
1198
Here is a likely non-exhaustive list of option names, please see the
1161
1199
source file F</src/optinc.h> to see the actual list:
1163
1201
borderLess console cursorBlink cursorUnderline hold iconic insecure
1184
1222
Please note that resource strings will currently only be freed when the
1185
1223
terminal is destroyed, so changing options frequently will eat memory.
1187
Here is a a likely non-exhaustive list of resource names, not all of which
1225
Here is a likely non-exhaustive list of resource names, not all of which
1188
1226
are supported in every build, please see the source file F</src/rsinc.h>
1189
1227
to see the actual list:
1507
1545
=item $cursor_is_hidden = $term->hidden_cursor
1509
Returns wether the cursor is currently hidden or not.
1547
Returns whether the cursor is currently hidden or not.
1511
1549
=item $view_start = $term->view_start ([$newvalue])
1694
1732
=item $string = $term->special_decode $text
1696
Converts rxvt-unicodes text reprsentation into a perl string. See
1734
Converts rxvt-unicodes text representation into a perl string. See
1697
1735
C<< $term->ROW_t >> for details.
1699
1737
=item $success = $term->grab_button ($button, $modifiermask[, $window = $term->vt])
1706
1744
=item $success = $term->grab ($eventtime[, $sync])
1708
1746
Calls XGrabPointer and XGrabKeyboard in asynchronous (default) or
1709
synchronous (C<$sync> is true). Also remembers the grab timestampe.
1747
synchronous (C<$sync> is true). Also remembers the grab timestamp.
1711
1749
=item $term->allow_events_async