… | |
… | |
31 | |
31 | |
32 | rxvt -pe <extensionname> |
32 | rxvt -pe <extensionname> |
33 | |
33 | |
34 | selection (enabled by default) |
34 | selection (enabled by default) |
35 | (More) intelligent selection. This extension tries to be more |
35 | (More) intelligent selection. This extension tries to be more |
36 | intelligent when the user extends selections (double-click). Right |
36 | intelligent when the user extends selections (double-click and |
37 | now, it tries to select urls and complete shell-quoted arguments, |
37 | further clicks). Right now, it tries to select words, urls and |
38 | which is very convenient, too, if your ls supports |
38 | complete shell-quoted arguments, which is very convenient, too, if |
39 | "--quoting-style=shell". |
39 | your ls supports "--quoting-style=shell". |
|
|
40 | |
|
|
41 | A double-click usually selects the word under the cursor, further |
|
|
42 | clicks will enlarge the selection. |
40 | |
43 | |
41 | It also offers the following bindable keyboard command: |
44 | It also offers the following bindable keyboard command: |
42 | |
45 | |
43 | rot13 |
46 | rot13 |
44 | Rot-13 the selection when activated. Used via keyboard trigger: |
47 | Rot-13 the selection when activated. Used via keyboard trigger: |
… | |
… | |
55 | unescaping, perl evalution, web-browser starting etc.), depending on |
58 | unescaping, perl evalution, web-browser starting etc.), depending on |
56 | content. |
59 | content. |
57 | |
60 | |
58 | searchable-scrollback<hotkey> (enabled by default) |
61 | searchable-scrollback<hotkey> (enabled by default) |
59 | Adds regex search functionality to the scrollback buffer, triggered |
62 | Adds regex search functionality to the scrollback buffer, triggered |
60 | by a hotkey (default: "M-s"). When in search mode, normal terminal |
63 | by a hotkey (default: "M-s"). While in search mode, normal terminal |
61 | input/output is suspended. |
64 | input/output is suspended and a regex is displayed at the bottom of |
|
|
65 | the screen. |
62 | |
66 | |
63 | "/" starts an incremental regex search, "n" searches further, "p" or |
67 | Inputting characters appends them to the regex and continues |
64 | "N" jump to the previous match, "G" jumps to the bottom and clears |
68 | incremental search. "BackSpace" removes a character from the regex, |
65 | the history, "enter" leaves search mode at the current position and |
69 | "Up" and "Down" search upwards/downwards in the scrollback buffer, |
66 | "escape" returns to the original position. |
70 | "End" jumps to the bottom. "Escape" leaves search mode and returns |
|
|
71 | to the point where search was started, while "Enter" or "Return" |
|
|
72 | stay at the current position and additionally stores the first match |
|
|
73 | in the current line into the primary selection. |
67 | |
74 | |
68 | digital-clock |
75 | digital-clock |
69 | Displays a digital clock using the built-in overlay. |
76 | Displays a digital clock using the built-in overlay. |
70 | |
77 | |
71 | mark-urls |
78 | mark-urls |
72 | Uses per-line display filtering ("on_line_update") to underline |
79 | Uses per-line display filtering ("on_line_update") to underline urls |
73 | urls. |
80 | and make them clickable. When middle-clicked, the program specified |
|
|
81 | in the resource "urlLauncher" (default "x-www-browser") will be |
|
|
82 | started with the URL as first argument. |
74 | |
83 | |
75 | block-graphics-to-ascii |
84 | block-graphics-to-ascii |
76 | A not very useful example of filtering all text output to the |
85 | A not very useful example of filtering all text output to the |
77 | terminal, by replacing all line-drawing characters (U+2500 .. |
86 | terminal, by replacing all line-drawing characters (U+2500 .. |
78 | U+259F) by a similar-looking ascii character. |
87 | U+259F) by a similar-looking ascii character. |
… | |
… | |
98 | Argument names also often indicate the type of a parameter. Here are |
107 | Argument names also often indicate the type of a parameter. Here are |
99 | some hints on what they mean: |
108 | some hints on what they mean: |
100 | |
109 | |
101 | $text |
110 | $text |
102 | Rxvt-unicodes special way of encoding text, where one "unicode" |
111 | Rxvt-unicodes special way of encoding text, where one "unicode" |
103 | character always represents one screen cell. See row_t for a |
112 | character always represents one screen cell. See ROW_t for a |
104 | discussion of this format. |
113 | discussion of this format. |
105 | |
114 | |
106 | $string |
115 | $string |
107 | A perl text string, with an emphasis on *text*. It can store all |
116 | A perl text string, with an emphasis on *text*. It can store all |
108 | unicode characters and is to be distinguished with text encoded in a |
117 | unicode characters and is to be distinguished with text encoded in a |
… | |
… | |
186 | |
195 | |
187 | on_sel_extend $term |
196 | on_sel_extend $term |
188 | Called whenever the user tries to extend the selection (e.g. with a |
197 | Called whenever the user tries to extend the selection (e.g. with a |
189 | double click) and is either supposed to return false (normal |
198 | double click) and is either supposed to return false (normal |
190 | operation), or should extend the selection itelf and return true to |
199 | operation), or should extend the selection itelf and return true to |
191 | suppress the built-in processing. |
200 | suppress the built-in processing. This can happen multiple times, as |
|
|
201 | long as the callback returns true, it will be called on every |
|
|
202 | further click by the user and is supposed to enlarge the selection |
|
|
203 | more and more, if possible. |
192 | |
204 | |
193 | See the selection example extension. |
205 | See the selection example extension. |
194 | |
206 | |
195 | on_view_change $term, $offset |
207 | on_view_change $term, $offset |
196 | Called whenever the view offset changes, i..e the user or program |
208 | Called whenever the view offset changes, i..e the user or program |
… | |
… | |
299 | |
311 | |
300 | $urxvt::TERM |
312 | $urxvt::TERM |
301 | The current terminal. This variable stores the current "urxvt::term" |
313 | The current terminal. This variable stores the current "urxvt::term" |
302 | object, whenever a callback/hook is executing. |
314 | object, whenever a callback/hook is executing. |
303 | |
315 | |
304 | * |
|
|
305 | |
|
|
306 | Functions in the "urxvt" Package |
316 | Functions in the "urxvt" Package |
307 | $term = new urxvt [arg...] |
|
|
308 | Creates a new terminal, very similar as if you had started it with |
|
|
309 | "system $binfile, arg...". Croaks (and probably outputs an error |
|
|
310 | message) if the new instance couldn't be created. Returns "undef" if |
|
|
311 | the new instance didn't initialise perl, and the terminal object |
|
|
312 | otherwise. The "init" and "start" hooks will be called during the |
|
|
313 | call. |
|
|
314 | |
|
|
315 | urxvt::fatal $errormessage |
317 | urxvt::fatal $errormessage |
316 | Fatally aborts execution with the given error message. Avoid at all |
318 | Fatally aborts execution with the given error message. Avoid at all |
317 | costs! The only time this is acceptable is when the terminal process |
319 | costs! The only time this is acceptable is when the terminal process |
318 | starts up. |
320 | starts up. |
319 | |
321 | |
… | |
… | |
322 | newline. The module also overwrites the "warn" builtin with a |
324 | newline. The module also overwrites the "warn" builtin with a |
323 | function that calls this function. |
325 | function that calls this function. |
324 | |
326 | |
325 | Using this function has the advantage that its output ends up in the |
327 | Using this function has the advantage that its output ends up in the |
326 | correct place, e.g. on stderr of the connecting urxvtc client. |
328 | correct place, e.g. on stderr of the connecting urxvtc client. |
|
|
329 | |
|
|
330 | Messages have a size limit of 1023 bytes currently. |
327 | |
331 | |
328 | $is_safe = urxvt::safe |
332 | $is_safe = urxvt::safe |
329 | Returns true when it is safe to do potentially unsafe things, such |
333 | Returns true when it is safe to do potentially unsafe things, such |
330 | as evaluating perl code specified by the user. This is true when |
334 | as evaluating perl code specified by the user. This is true when |
331 | urxvt was started setuid or setgid. |
335 | urxvt was started setuid or setgid. |
… | |
… | |
385 | condition variables, but non-blocking condvar use is ok. What this means |
389 | condition variables, but non-blocking condvar use is ok. What this means |
386 | is that you cannot use blocking APIs, but the non-blocking variant |
390 | is that you cannot use blocking APIs, but the non-blocking variant |
387 | should work. |
391 | should work. |
388 | |
392 | |
389 | The "urxvt::term" Class |
393 | The "urxvt::term" Class |
|
|
394 | $term = new urxvt::term $envhashref, $rxvtname, [arg...] |
|
|
395 | Creates a new terminal, very similar as if you had started it with |
|
|
396 | system "$rxvtname, arg...". $envhashref must be a reference to a |
|
|
397 | %ENV-like hash which defines the environment of the new terminal. |
|
|
398 | |
|
|
399 | Croaks (and probably outputs an error message) if the new instance |
|
|
400 | couldn't be created. Returns "undef" if the new instance didn't |
|
|
401 | initialise perl, and the terminal object otherwise. The "init" and |
|
|
402 | "start" hooks will be called during this call. |
|
|
403 | |
390 | $term->destroy |
404 | $term->destroy |
391 | Destroy the terminal object (close the window, free resources etc.). |
405 | Destroy the terminal object (close the window, free resources etc.). |
392 | Please note that rxvt will not exit as long as any event watchers |
406 | Please note that rxvt will not exit as long as any event watchers |
393 | (timers, io watchers) are still active. |
407 | (timers, io watchers) are still active. |
394 | |
408 | |
… | |
… | |
440 | scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput |
454 | scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput |
441 | scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle |
455 | scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle |
442 | shade term_name title transparent transparent_all tripleclickwords |
456 | shade term_name title transparent transparent_all tripleclickwords |
443 | utmpInhibit visualBell |
457 | utmpInhibit visualBell |
444 | |
458 | |
|
|
459 | $value = $term->x_resource ($pattern) |
|
|
460 | Returns the X-Resource for the given pattern, excluding the program |
|
|
461 | or class name, i.e. "$term->x_resource ("boldFont")" should return |
|
|
462 | the same value as used by this instance of rxvt-unicode. Returns |
|
|
463 | "undef" if no resource with that pattern exists. |
|
|
464 | |
|
|
465 | This method should only be called during the "on_start" hook, as |
|
|
466 | there is only one resource database per display, and later |
|
|
467 | invocations might return the wrong resources. |
|
|
468 | |
445 | $success = $term->parse_keysym ($keysym_spec, $command_string) |
469 | $success = $term->parse_keysym ($keysym_spec, $command_string) |
446 | Adds a keymap translation exactly as specified via a resource. See |
470 | Adds a keymap translation exactly as specified via a resource. See |
447 | the "keysym" resource in the rxvt(1) manpage. |
471 | the "keysym" resource in the rxvt(1) manpage. |
448 | |
472 | |
449 | $rend = $term->rstyle ([$new_rstyle]) |
473 | $rend = $term->rstyle ([$new_rstyle]) |
… | |
… | |
459 | ($row, $col) = $term->selection_beg ([$row, $col]) |
483 | ($row, $col) = $term->selection_beg ([$row, $col]) |
460 | ($row, $col) = $term->selection_end ([$row, $col]) |
484 | ($row, $col) = $term->selection_end ([$row, $col]) |
461 | Return the current values of the selection mark, begin or end |
485 | Return the current values of the selection mark, begin or end |
462 | positions, and optionally set them to new values. |
486 | positions, and optionally set them to new values. |
463 | |
487 | |
|
|
488 | $term->selection_make ($eventtime[, $rectangular]) |
|
|
489 | Tries to make a selection as set by "selection_beg" and |
|
|
490 | "selection_end". If $rectangular is true (default: false), a |
|
|
491 | rectangular selection will be made. This is the prefered function to |
|
|
492 | make a selection. |
|
|
493 | |
464 | $success = $term->selection_grab ($eventtime) |
494 | $success = $term->selection_grab ($eventtime) |
465 | Try to request the primary selection from the server (for example, |
495 | Try to request the primary selection text from the server (for |
466 | as set by the next method). |
496 | example, as set by the next method). No visual feedback will be |
|
|
497 | given. This function is mostly useful from within "on_sel_grab" |
|
|
498 | hooks. |
467 | |
499 | |
468 | $oldtext = $term->selection ([$newtext]) |
500 | $oldtext = $term->selection ([$newtext]) |
469 | Return the current selection text and optionally replace it by |
501 | Return the current selection text and optionally replace it by |
470 | $newtext. |
502 | $newtext. |
471 | |
503 | |
… | |
… | |
516 | $string = $term->locale_decode ($octets) |
548 | $string = $term->locale_decode ($octets) |
517 | Convert the given locale-encoded octets into a perl string. |
549 | Convert the given locale-encoded octets into a perl string. |
518 | |
550 | |
519 | $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle]) |
551 | $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle]) |
520 | XORs the rendition values in the given span with the provided value |
552 | XORs the rendition values in the given span with the provided value |
521 | (default: "RS_RVid"). Useful in refresh hooks to provide effects |
553 | (default: "RS_RVid"), which *MUST NOT* contain font styles. Useful |
522 | similar to the selection. |
554 | in refresh hooks to provide effects similar to the selection. |
523 | |
555 | |
524 | $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, |
556 | $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, |
525 | $rstyle2]]) |
557 | $rstyle2]]) |
526 | Similar to "scr_xor_span", but xors a rectangle instead. Trailing |
558 | Similar to "scr_xor_span", but xors a rectangle instead. Trailing |
527 | whitespace will additionally be xored with the $rstyle2, which |
559 | whitespace will additionally be xored with the $rstyle2, which |
528 | defaults to "RS_RVid | RS_Uline", which removes reverse video again |
560 | defaults to "RS_RVid | RS_Uline", which removes reverse video again |
529 | and underlines it instead. |
561 | and underlines it instead. Both styles *MUST NOT* contain font |
|
|
562 | styles. |
530 | |
563 | |
531 | $term->scr_bell |
564 | $term->scr_bell |
532 | Ring the bell! |
565 | Ring the bell! |
533 | |
566 | |
534 | $term->scr_add_lines ($string) |
567 | $term->scr_add_lines ($string) |
… | |
… | |
577 | $max_scrollback = $term->saveLines |
610 | $max_scrollback = $term->saveLines |
578 | $nrow_plus_saveLines = $term->total_rows |
611 | $nrow_plus_saveLines = $term->total_rows |
579 | $lines_in_scrollback = $term->nsaved |
612 | $lines_in_scrollback = $term->nsaved |
580 | Return various integers describing terminal characteristics. |
613 | Return various integers describing terminal characteristics. |
581 | |
614 | |
|
|
615 | $x_display = $term->display_id |
|
|
616 | Return the DISPLAY used by rxvt-unicode. |
|
|
617 | |
582 | $lc_ctype = $term->locale |
618 | $lc_ctype = $term->locale |
583 | Returns the LC_CTYPE category string used by this rxvt-unicode. |
619 | Returns the LC_CTYPE category string used by this rxvt-unicode. |
584 | |
620 | |
585 | $x_display = $term->display_id |
621 | $env = $term->env |
586 | Return the DISPLAY used by rxvt-unicode. |
622 | Returns a copy of the environment in effect for the terminal as a |
|
|
623 | hashref similar to "\%ENV". |
587 | |
624 | |
588 | $modifiermask = $term->ModLevel3Mask |
625 | $modifiermask = $term->ModLevel3Mask |
589 | $modifiermask = $term->ModMetaMask |
626 | $modifiermask = $term->ModMetaMask |
590 | $modifiermask = $term->ModNumLockMask |
627 | $modifiermask = $term->ModNumLockMask |
591 | Return the modifier masks corresponding to the "ISO Level 3 Shift" |
628 | Return the modifier masks corresponding to the "ISO Level 3 Shift" |
… | |
… | |
670 | Return the row number of the first/last row of the line, |
707 | Return the row number of the first/last row of the line, |
671 | respectively. |
708 | respectively. |
672 | |
709 | |
673 | $offset = $line->offset_of ($row, $col) |
710 | $offset = $line->offset_of ($row, $col) |
674 | Returns the character offset of the given row|col pair within |
711 | Returns the character offset of the given row|col pair within |
675 | the logical line. |
712 | the logical line. Works for rows outside the line, too, and |
|
|
713 | returns corresponding offsets outside the string. |
676 | |
714 | |
677 | ($row, $col) = $line->coord_of ($offset) |
715 | ($row, $col) = $line->coord_of ($offset) |
678 | Translates a string offset into terminal coordinates again. |
716 | Translates a string offset into terminal coordinates again. |
679 | |
717 | |
680 | $text = $term->special_encode $string |
718 | $text = $term->special_encode $string |
… | |
… | |
727 | |
765 | |
728 | $popup->show |
766 | $popup->show |
729 | Displays the popup (which is initially hidden). |
767 | Displays the popup (which is initially hidden). |
730 | |
768 | |
731 | The "urxvt::timer" Class |
769 | The "urxvt::timer" Class |
732 | This class implements timer watchers/events. Time is represented as |
770 | This class implements timer watchers/events. Time is represented as a |
733 | a fractional number of seconds since the epoch. Example: |
771 | fractional number of seconds since the epoch. Example: |
734 | |
772 | |
735 | $term->{overlay} = $term->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0); |
773 | $term->{overlay} = $term->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0); |
736 | $term->{timer} = urxvt::timer |
774 | $term->{timer} = urxvt::timer |
737 | ->new |
775 | ->new |
738 | ->interval (1) |
776 | ->interval (1) |
739 | ->cb (sub { |
777 | ->cb (sub { |
740 | $term->{overlay}->set (0, 0, |
778 | $term->{overlay}->set (0, 0, |
741 | sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]); |
779 | sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]); |
742 | }); |
780 | }); |
743 | |
781 | |
744 | $timer = new urxvt::timer |
782 | $timer = new urxvt::timer |
745 | Create a new timer object in started state. It is scheduled to |
783 | Create a new timer object in started state. It is scheduled to fire |
746 | fire immediately. |
784 | immediately. |
747 | |
785 | |
748 | $timer = $timer->cb (sub { my ($timer) = @_; ... }) |
786 | $timer = $timer->cb (sub { my ($timer) = @_; ... }) |
749 | Set the callback to be called when the timer triggers. |
787 | Set the callback to be called when the timer triggers. |
750 | |
788 | |
751 | $tstamp = $timer->at |
789 | $tstamp = $timer->at |
752 | Return the time this watcher will fire next. |
790 | Return the time this watcher will fire next. |
753 | |
791 | |
754 | $timer = $timer->set ($tstamp) |
792 | $timer = $timer->set ($tstamp) |
755 | Set the time the event is generated to $tstamp. |
793 | Set the time the event is generated to $tstamp. |
756 | |
794 | |
757 | $timer = $timer->interval ($interval) |
795 | $timer = $timer->interval ($interval) |
758 | Normally (and when $interval is 0), the timer will automatically |
796 | Normally (and when $interval is 0), the timer will automatically |
759 | stop after it has fired once. If $interval is non-zero, then the |
797 | stop after it has fired once. If $interval is non-zero, then the |
760 | timer is automatically rescheduled at the given intervals. |
798 | timer is automatically rescheduled at the given intervals. |
761 | |
799 | |
762 | $timer = $timer->start |
800 | $timer = $timer->start |
763 | Start the timer. |
801 | Start the timer. |
764 | |
802 | |
765 | $timer = $timer->start ($tstamp) |
803 | $timer = $timer->start ($tstamp) |
766 | Set the event trigger time to $tstamp and start the timer. |
804 | Set the event trigger time to $tstamp and start the timer. |
767 | |
805 | |
768 | $timer = $timer->stop |
806 | $timer = $timer->stop |
769 | Stop the timer. |
807 | Stop the timer. |
770 | |
808 | |
771 | The "urxvt::iow" Class |
809 | The "urxvt::iow" Class |
772 | This class implements io watchers/events. Example: |
810 | This class implements io watchers/events. Example: |
773 | |
811 | |
774 | $term->{socket} = ... |
812 | $term->{socket} = ... |
775 | $term->{iow} = urxvt::iow |
813 | $term->{iow} = urxvt::iow |
776 | ->new |
814 | ->new |
777 | ->fd (fileno $term->{socket}) |
815 | ->fd (fileno $term->{socket}) |
778 | ->events (urxvt::EVENT_READ) |
816 | ->events (urxvt::EVENT_READ) |
779 | ->start |
817 | ->start |
780 | ->cb (sub { |
818 | ->cb (sub { |
781 | my ($iow, $revents) = @_; |
819 | my ($iow, $revents) = @_; |
782 | # $revents must be 1 here, no need to check |
820 | # $revents must be 1 here, no need to check |
783 | sysread $term->{socket}, my $buf, 8192 |
821 | sysread $term->{socket}, my $buf, 8192 |
784 | or end-of-file; |
822 | or end-of-file; |
785 | }); |
823 | }); |
786 | |
824 | |
787 | $iow = new urxvt::iow |
825 | $iow = new urxvt::iow |
788 | Create a new io watcher object in stopped state. |
826 | Create a new io watcher object in stopped state. |
789 | |
827 | |
790 | $iow = $iow->cb (sub { my ($iow, $reventmask) = @_; ... }) |
828 | $iow = $iow->cb (sub { my ($iow, $reventmask) = @_; ... }) |
791 | Set the callback to be called when io events are triggered. |
829 | Set the callback to be called when io events are triggered. |
792 | $reventmask is a bitset as described in the "events" method. |
830 | $reventmask is a bitset as described in the "events" method. |
793 | |
831 | |
794 | $iow = $iow->fd ($fd) |
832 | $iow = $iow->fd ($fd) |
795 | Set the filedescriptor (not handle) to watch. |
833 | Set the filedescriptor (not handle) to watch. |
796 | |
834 | |
797 | $iow = $iow->events ($eventmask) |
835 | $iow = $iow->events ($eventmask) |
798 | Set the event mask to watch. The only allowed values are |
836 | Set the event mask to watch. The only allowed values are |
799 | "urxvt::EVENT_READ" and "urxvt::EVENT_WRITE", which might be |
837 | "urxvt::EVENT_READ" and "urxvt::EVENT_WRITE", which might be ORed |
800 | ORed together, or "urxvt::EVENT_NONE". |
838 | together, or "urxvt::EVENT_NONE". |
801 | |
839 | |
802 | $iow = $iow->start |
840 | $iow = $iow->start |
803 | Start watching for requested events on the given handle. |
841 | Start watching for requested events on the given handle. |
804 | |
842 | |
805 | $iow = $iow->stop |
843 | $iow = $iow->stop |
806 | Stop watching for events on the given filehandle. |
844 | Stop watching for events on the given filehandle. |
807 | |
845 | |
808 | ENVIRONMENT |
846 | ENVIRONMENT |
809 | URXVT_PERL_VERBOSITY |
847 | URXVT_PERL_VERBOSITY |
810 | This variable controls the verbosity level of the perl extension. |
848 | This variable controls the verbosity level of the perl extension. Higher |
811 | Higher numbers indicate more verbose output. |
849 | numbers indicate more verbose output. |
812 | |
850 | |
813 | == 0 - fatal messages |
851 | == 0 - fatal messages |
814 | >= 3 - script loading and management |
852 | >= 3 - script loading and management |
815 | >=10 - all events received |
853 | >=10 - all called hooks |
|
|
854 | >=11 - hook reutrn values |
816 | |
855 | |
817 | AUTHOR |
856 | AUTHOR |
818 | Marc Lehmann <pcg@goof.com> |
857 | Marc Lehmann <pcg@goof.com> |
819 | http://software.schmorp.de/pkg/rxvt-unicode |
858 | http://software.schmorp.de/pkg/rxvt-unicode |
820 | |
859 | |