… | |
… | |
49 | options at runtime. |
49 | options at runtime. |
50 | |
50 | |
51 | selection-popup (enabled by default) |
51 | selection-popup (enabled by default) |
52 | Binds a popup menu to Ctrl-Button3 that lets you convert the |
52 | Binds a popup menu to Ctrl-Button3 that lets you convert the |
53 | selection text into various other formats/action. |
53 | selection text into various other formats/action. |
|
|
54 | |
|
|
55 | searchable-scrollback<hotkey> (enabled by default) |
|
|
56 | Adds regex search functionality to the scrollback buffer, triggered |
|
|
57 | by a hotkey (default: "M-s"). When in search mode, normal terminal |
|
|
58 | input/output is suspended. |
|
|
59 | |
|
|
60 | "/" starts an incremental regex search, "n" searches further, "p" or |
|
|
61 | "N" jump to the previous match, "G" jumps to the bottom and clears |
|
|
62 | the history, "enter" leaves search mode at the current position and |
|
|
63 | "escape" returns to the original position. |
54 | |
64 | |
55 | digital-clock |
65 | digital-clock |
56 | Displays a digital clock using the built-in overlay. |
66 | Displays a digital clock using the built-in overlay. |
57 | |
67 | |
58 | mark-urls |
68 | mark-urls |
… | |
… | |
96 | |
106 | |
97 | $octets |
107 | $octets |
98 | Either binary data or - more common - a text string encoded in a |
108 | Either binary data or - more common - a text string encoded in a |
99 | locale-specific way. |
109 | locale-specific way. |
100 | |
110 | |
|
|
111 | Extension Objects |
|
|
112 | Very perl extension is a perl class. A separate perl object is created |
|
|
113 | for each terminal and each extension and passed as the first parameter |
|
|
114 | to hooks. So extensions can use their $self object without having to |
|
|
115 | think about other extensions, with the exception of methods and members |
|
|
116 | that begin with an underscore character "_": these are reserved for |
|
|
117 | internal use. |
|
|
118 | |
|
|
119 | Although it isn't a "urxvt::term" object, you can call all methods of |
|
|
120 | the "urxvt::term" class on this object. |
|
|
121 | |
|
|
122 | It has the following methods and data members: |
|
|
123 | |
|
|
124 | $urxvt_term = $self->{term} |
|
|
125 | Returns the "urxvt::term" object associated with this instance of |
|
|
126 | the extension. This member *must not* be changed in any way. |
|
|
127 | |
|
|
128 | $self->enable ($hook_name => $cb, [$hook_name => $cb..]) |
|
|
129 | Dynamically enable the given hooks (named without the "on_" prefix) |
|
|
130 | for this extension, replacing any previous hook. This is useful when |
|
|
131 | you want to overwrite time-critical hooks only temporarily. |
|
|
132 | |
|
|
133 | $self->disable ($hook_name[, $hook_name..]) |
|
|
134 | Dynamically disable the given hooks. |
|
|
135 | |
101 | Hooks |
136 | Hooks |
102 | The following subroutines can be declared in extension files, and will |
137 | The following subroutines can be declared in extension files, and will |
103 | be called whenever the relevant event happens. |
138 | be called whenever the relevant event happens. |
104 | |
139 | |
105 | The first argument passed to them is an object private to each terminal |
140 | The first argument passed to them is an extension oject as described in |
106 | and extension package. You can call all "urxvt::term" methods on it, but |
141 | the in the "Extension Objects" section. |
107 | its not a real "urxvt::term" object. Instead, the real "urxvt::term" |
|
|
108 | object that is shared between all packages is stored in the "term" |
|
|
109 | member. It is, however, blessed intot he package of the extension |
|
|
110 | script, so for all practical purposes you can treat an extension script |
|
|
111 | as a class. |
|
|
112 | |
142 | |
113 | All of them must return a boolean value. If it is true, then the event |
143 | All of these hooks must return a boolean value. If it is true, then the |
114 | counts as being *consumed*, and the invocation of other hooks is |
144 | event counts as being *consumed*, and the invocation of other hooks is |
115 | skipped, and the relevant action might not be carried out by the C++ |
145 | skipped, and the relevant action might not be carried out by the C++ |
116 | code. |
146 | code. |
117 | |
147 | |
118 | When in doubt, return a false value (preferably "()"). |
148 | *When in doubt, return a false value (preferably "()").* |
119 | |
149 | |
120 | on_init $term |
150 | on_init $term |
121 | Called after a new terminal object has been initialized, but before |
151 | Called after a new terminal object has been initialized, but before |
122 | windows are created or the command gets run. Most methods are unsafe |
152 | windows are created or the command gets run. Most methods are unsafe |
123 | to call or deliver senseless data, as terminal size and other |
153 | to call or deliver senseless data, as terminal size and other |
… | |
… | |
189 | argument. You can filter/change and output the text yourself by |
219 | argument. You can filter/change and output the text yourself by |
190 | returning a true value and calling "$term->scr_add_lines" yourself. |
220 | returning a true value and calling "$term->scr_add_lines" yourself. |
191 | Please note that this might be very slow, however, as your hook is |
221 | Please note that this might be very slow, however, as your hook is |
192 | called for all text being output. |
222 | called for all text being output. |
193 | |
223 | |
|
|
224 | on_tt_write $term, $octets |
|
|
225 | Called whenever some data is written to the tty/pty and can be used |
|
|
226 | to suppress or filter tty input. |
|
|
227 | |
194 | on_line_update $term, $row |
228 | on_line_update $term, $row |
195 | Called whenever a line was updated or changed. Can be used to filter |
229 | Called whenever a line was updated or changed. Can be used to filter |
196 | screen output (e.g. underline urls or other useless stuff). Only |
230 | screen output (e.g. underline urls or other useless stuff). Only |
197 | lines that are being shown will be filtered, and, due to performance |
231 | lines that are being shown will be filtered, and, due to performance |
198 | reasons, not always immediately. |
232 | reasons, not always immediately. |
… | |
… | |
225 | |
259 | |
226 | on_focus_out $term |
260 | on_focus_out $term |
227 | Called wheneever the window loses keyboard focus, before |
261 | Called wheneever the window loses keyboard focus, before |
228 | rxvt-unicode does focus out processing. |
262 | rxvt-unicode does focus out processing. |
229 | |
263 | |
230 | on_key_press $term, $event, $octets |
264 | on_key_press $term, $event, $keysym, $octets |
231 | on_key_release $term, $event |
265 | on_key_release $term, $event, $keysym |
232 | on_button_press $term, $event |
266 | on_button_press $term, $event |
233 | on_button_release $term, $event |
267 | on_button_release $term, $event |
234 | on_motion_notify $term, $event |
268 | on_motion_notify $term, $event |
235 | on_map_notify $term, $event |
269 | on_map_notify $term, $event |
236 | on_unmap_notify $term, $event |
270 | on_unmap_notify $term, $event |
… | |
… | |
271 | newline. The module also overwrites the "warn" builtin with a |
305 | newline. The module also overwrites the "warn" builtin with a |
272 | function that calls this function. |
306 | function that calls this function. |
273 | |
307 | |
274 | Using this function has the advantage that its output ends up in the |
308 | Using this function has the advantage that its output ends up in the |
275 | correct place, e.g. on stderr of the connecting urxvtc client. |
309 | correct place, e.g. on stderr of the connecting urxvtc client. |
|
|
310 | |
|
|
311 | $is_safe = urxvt::safe |
|
|
312 | Returns true when it is safe to do potentially unsafe things, such |
|
|
313 | as evaluating perl code specified by the user. This is true when |
|
|
314 | urxvt was started setuid or setgid. |
276 | |
315 | |
277 | $time = urxvt::NOW |
316 | $time = urxvt::NOW |
278 | Returns the "current time" (as per the event loop). |
317 | Returns the "current time" (as per the event loop). |
279 | |
318 | |
280 | urxvt::CurrentTime |
319 | urxvt::CurrentTime |
… | |
… | |
381 | scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput |
420 | scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput |
382 | scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle |
421 | scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle |
383 | shade term_name title transparent transparent_all tripleclickwords |
422 | shade term_name title transparent transparent_all tripleclickwords |
384 | utmpInhibit visualBell |
423 | utmpInhibit visualBell |
385 | |
424 | |
|
|
425 | $success = $term->parse_keysym ($keysym_spec, $command_string) |
|
|
426 | Adds a keymap translation exactly as specified via a resource. See |
|
|
427 | the "keysym" resource in the rxvt(1) manpage. |
|
|
428 | |
386 | $rend = $term->rstyle ([$new_rstyle]) |
429 | $rend = $term->rstyle ([$new_rstyle]) |
387 | Return and optionally change the current rendition. Text that is |
430 | Return and optionally change the current rendition. Text that is |
388 | output by the terminal application will use this style. |
431 | output by the terminal application will use this style. |
389 | |
432 | |
390 | ($row, $col) = $term->screen_cur ([$row, $col]) |
433 | ($row, $col) = $term->screen_cur ([$row, $col]) |
… | |
… | |
404 | |
447 | |
405 | $oldtext = $term->selection ([$newtext]) |
448 | $oldtext = $term->selection ([$newtext]) |
406 | Return the current selection text and optionally replace it by |
449 | Return the current selection text and optionally replace it by |
407 | $newtext. |
450 | $newtext. |
408 | |
451 | |
409 | #=item $term->overlay ($x, $y, $text) # #Create a simple multi-line |
452 | $term->overlay_simple ($x, $y, $text) |
410 | overlay box. See the next method for details. # #=cut # #sub |
453 | Create a simple multi-line overlay box. See the next method for |
411 | urxvt::term::scr_overlay { # my ($self, $x, $y, $text) = @_; # # my |
454 | details. |
412 | @lines = split /\n/, $text; # # my $w = 0; # for (map |
|
|
413 | $self->strwidth ($_), @lines) { # $w = $_ if $w < $_; # } # # |
|
|
414 | $self->scr_overlay_new ($x, $y, $w, scalar @lines); # |
|
|
415 | $self->scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines; #} |
|
|
416 | |
455 | |
417 | $term->overlay ($x, $y, $width, $height[, $rstyle[, $border]]) |
456 | $term->overlay ($x, $y, $width, $height[, $rstyle[, $border]]) |
418 | Create a new (empty) overlay at the given position with the given |
457 | Create a new (empty) overlay at the given position with the given |
419 | width/height. $rstyle defines the initial rendition style (default: |
458 | width/height. $rstyle defines the initial rendition style (default: |
420 | "OVERLAY_RSTYLE"). |
459 | "OVERLAY_RSTYLE"). |
… | |
… | |
454 | Convert the given text string into the corresponding locale |
493 | Convert the given text string into the corresponding locale |
455 | encoding. |
494 | encoding. |
456 | |
495 | |
457 | $string = $term->locale_decode ($octets) |
496 | $string = $term->locale_decode ($octets) |
458 | Convert the given locale-encoded octets into a perl string. |
497 | Convert the given locale-encoded octets into a perl string. |
|
|
498 | |
|
|
499 | $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle]) |
|
|
500 | XORs the rendition values in the given span with the provided value |
|
|
501 | (default: "RS_RVid"). Useful in refresh hooks to provide effects |
|
|
502 | similar to the selection. |
|
|
503 | |
|
|
504 | $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, |
|
|
505 | $rstyle2]]) |
|
|
506 | Similar to "scr_xor_span", but xors a rectangle instead. Trailing |
|
|
507 | whitespace will additionally be xored with the $rstyle2, which |
|
|
508 | defaults to "RS_RVid | RS_Uline", which removes reverse video again |
|
|
509 | and underlines it instead. |
|
|
510 | |
|
|
511 | $term->scr_bell |
|
|
512 | Ring the bell! |
459 | |
513 | |
460 | $term->scr_add_lines ($string) |
514 | $term->scr_add_lines ($string) |
461 | Write the given text string to the screen, as if output by the |
515 | Write the given text string to the screen, as if output by the |
462 | application running inside the terminal. It may not contain command |
516 | application running inside the terminal. It may not contain command |
463 | sequences (escape codes), but is free to use line feeds, carriage |
517 | sequences (escape codes), but is free to use line feeds, carriage |
… | |
… | |
476 | $term->tt_write ($octets) |
530 | $term->tt_write ($octets) |
477 | Write the octets given in $data to the tty (i.e. as program input). |
531 | Write the octets given in $data to the tty (i.e. as program input). |
478 | To pass characters instead of octets, you should convert your |
532 | To pass characters instead of octets, you should convert your |
479 | strings first to the locale-specific encoding using |
533 | strings first to the locale-specific encoding using |
480 | "$term->locale_encode". |
534 | "$term->locale_encode". |
|
|
535 | |
|
|
536 | $old_events = $term->pty_ev_events ([$new_events]) |
|
|
537 | Replaces the event mask of the pty watcher by the given event mask. |
|
|
538 | Can be used to suppress input and output handling to the pty/tty. |
|
|
539 | See the description of "urxvt::timer->events". Make sure to always |
|
|
540 | restore the previous value. |
481 | |
541 | |
482 | $windowid = $term->parent |
542 | $windowid = $term->parent |
483 | Return the window id of the toplevel window. |
543 | Return the window id of the toplevel window. |
484 | |
544 | |
485 | $windowid = $term->vt |
545 | $windowid = $term->vt |
… | |
… | |
497 | $max_scrollback = $term->saveLines |
557 | $max_scrollback = $term->saveLines |
498 | $nrow_plus_saveLines = $term->total_rows |
558 | $nrow_plus_saveLines = $term->total_rows |
499 | $lines_in_scrollback = $term->nsaved |
559 | $lines_in_scrollback = $term->nsaved |
500 | Return various integers describing terminal characteristics. |
560 | Return various integers describing terminal characteristics. |
501 | |
561 | |
|
|
562 | $lc_ctype = $term->locale |
|
|
563 | Returns the LC_CTYPE category string used by this rxvt-unicode. |
|
|
564 | |
|
|
565 | $x_display = $term->display_id |
|
|
566 | Return the DISPLAY used by rxvt-unicode. |
|
|
567 | |
502 | $modifiermask = $term->ModLevel3Mask |
568 | $modifiermask = $term->ModLevel3Mask |
503 | $modifiermask = $term->ModMetaMask |
569 | $modifiermask = $term->ModMetaMask |
504 | $modifiermask = $term->ModNumLockMask |
570 | $modifiermask = $term->ModNumLockMask |
505 | Return the modifier masks corresponding to the "ISO Level 3 Shift" |
571 | Return the modifier masks corresponding to the "ISO Level 3 Shift" |
506 | (often AltGr), the meta key (often Alt) and the num lock key, if |
572 | (often AltGr), the meta key (often Alt) and the num lock key, if |
… | |
… | |
599 | $string = $term->special_decode $text |
665 | $string = $term->special_decode $text |
600 | Converts rxvt-unicodes text reprsentation into a perl string. See |
666 | Converts rxvt-unicodes text reprsentation into a perl string. See |
601 | "$term->ROW_t" for details. |
667 | "$term->ROW_t" for details. |
602 | |
668 | |
603 | $success = $term->grab_button ($button, $modifiermask) |
669 | $success = $term->grab_button ($button, $modifiermask) |
604 | Registers a synchronous button grab. See XGrabButton. |
670 | Registers a synchronous button grab. See the XGrabButton manpage. |
605 | |
671 | |
606 | $success = $term->grab ($eventtime[, $sync]) |
672 | $success = $term->grab ($eventtime[, $sync]) |
607 | Calls XGrabPointer and XGrabKeyboard in asynchronous (default) or |
673 | Calls XGrabPointer and XGrabKeyboard in asynchronous (default) or |
608 | synchronous ($sync is true). Also remembers the grab timestampe. |
674 | synchronous ($sync is true). Also remembers the grab timestampe. |
609 | |
675 | |
… | |
… | |
668 | |
734 | |
669 | $term->{socket} = ... |
735 | $term->{socket} = ... |
670 | $term->{iow} = urxvt::iow |
736 | $term->{iow} = urxvt::iow |
671 | ->new |
737 | ->new |
672 | ->fd (fileno $term->{socket}) |
738 | ->fd (fileno $term->{socket}) |
673 | ->events (1) # wait for read data |
739 | ->events (urxvt::EVENT_READ) |
674 | ->start |
740 | ->start |
675 | ->cb (sub { |
741 | ->cb (sub { |
676 | my ($iow, $revents) = @_; |
742 | my ($iow, $revents) = @_; |
677 | # $revents must be 1 here, no need to check |
743 | # $revents must be 1 here, no need to check |
678 | sysread $term->{socket}, my $buf, 8192 |
744 | sysread $term->{socket}, my $buf, 8192 |
… | |
… | |
688 | |
754 | |
689 | $iow = $iow->fd ($fd) |
755 | $iow = $iow->fd ($fd) |
690 | Set the filedescriptor (not handle) to watch. |
756 | Set the filedescriptor (not handle) to watch. |
691 | |
757 | |
692 | $iow = $iow->events ($eventmask) |
758 | $iow = $iow->events ($eventmask) |
693 | Set the event mask to watch. Bit #0 (value 1) enables watching |
759 | Set the event mask to watch. The only allowed values are |
694 | for read data, Bit #1 (value 2) enables watching for write data. |
760 | "urxvt::EVENT_READ" and "urxvt::EVENT_WRITE", which might be |
|
|
761 | ORed together, or "urxvt::EVENT_NONE". |
695 | |
762 | |
696 | $iow = $iow->start |
763 | $iow = $iow->start |
697 | Start watching for requested events on the given handle. |
764 | Start watching for requested events on the given handle. |
698 | |
765 | |
699 | $iow = $iow->stop |
766 | $iow = $iow->stop |