ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/doc/rxvtperl.3.txt
(Generate patch)

Comparing rxvt-unicode/doc/rxvtperl.3.txt (file contents):
Revision 1.16 by root, Mon Jan 9 07:17:24 2006 UTC vs.
Revision 1.17 by root, Tue Jan 10 04:26:54 2006 UTC

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
386 scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput 420 scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput
387 scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle 421 scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle
388 shade term_name title transparent transparent_all tripleclickwords 422 shade term_name title transparent transparent_all tripleclickwords
389 utmpInhibit visualBell 423 utmpInhibit visualBell
390 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
391 $rend = $term->rstyle ([$new_rstyle]) 429 $rend = $term->rstyle ([$new_rstyle])
392 Return and optionally change the current rendition. Text that is 430 Return and optionally change the current rendition. Text that is
393 output by the terminal application will use this style. 431 output by the terminal application will use this style.
394 432
395 ($row, $col) = $term->screen_cur ([$row, $col]) 433 ($row, $col) = $term->screen_cur ([$row, $col])
409 447
410 $oldtext = $term->selection ([$newtext]) 448 $oldtext = $term->selection ([$newtext])
411 Return the current selection text and optionally replace it by 449 Return the current selection text and optionally replace it by
412 $newtext. 450 $newtext.
413 451
414 #=item $term->overlay ($x, $y, $text) # #Create a simple multi-line 452 $term->overlay_simple ($x, $y, $text)
415 overlay box. See the next method for details. # #=cut # #sub 453 Create a simple multi-line overlay box. See the next method for
416 urxvt::term::scr_overlay { # my ($self, $x, $y, $text) = @_; # # my 454 details.
417 @lines = split /\n/, $text; # # my $w = 0; # for (map
418 $self->strwidth ($_), @lines) { # $w = $_ if $w < $_; # } # #
419 $self->scr_overlay_new ($x, $y, $w, scalar @lines); #
420 $self->scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines; #}
421 455
422 $term->overlay ($x, $y, $width, $height[, $rstyle[, $border]]) 456 $term->overlay ($x, $y, $width, $height[, $rstyle[, $border]])
423 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
424 width/height. $rstyle defines the initial rendition style (default: 458 width/height. $rstyle defines the initial rendition style (default:
425 "OVERLAY_RSTYLE"). 459 "OVERLAY_RSTYLE").
459 Convert the given text string into the corresponding locale 493 Convert the given text string into the corresponding locale
460 encoding. 494 encoding.
461 495
462 $string = $term->locale_decode ($octets) 496 $string = $term->locale_decode ($octets)
463 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!
464 513
465 $term->scr_add_lines ($string) 514 $term->scr_add_lines ($string)
466 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
467 application running inside the terminal. It may not contain command 516 application running inside the terminal. It may not contain command
468 sequences (escape codes), but is free to use line feeds, carriage 517 sequences (escape codes), but is free to use line feeds, carriage
481 $term->tt_write ($octets) 530 $term->tt_write ($octets)
482 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).
483 To pass characters instead of octets, you should convert your 532 To pass characters instead of octets, you should convert your
484 strings first to the locale-specific encoding using 533 strings first to the locale-specific encoding using
485 "$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.
486 541
487 $windowid = $term->parent 542 $windowid = $term->parent
488 Return the window id of the toplevel window. 543 Return the window id of the toplevel window.
489 544
490 $windowid = $term->vt 545 $windowid = $term->vt
502 $max_scrollback = $term->saveLines 557 $max_scrollback = $term->saveLines
503 $nrow_plus_saveLines = $term->total_rows 558 $nrow_plus_saveLines = $term->total_rows
504 $lines_in_scrollback = $term->nsaved 559 $lines_in_scrollback = $term->nsaved
505 Return various integers describing terminal characteristics. 560 Return various integers describing terminal characteristics.
506 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
507 $modifiermask = $term->ModLevel3Mask 568 $modifiermask = $term->ModLevel3Mask
508 $modifiermask = $term->ModMetaMask 569 $modifiermask = $term->ModMetaMask
509 $modifiermask = $term->ModNumLockMask 570 $modifiermask = $term->ModNumLockMask
510 Return the modifier masks corresponding to the "ISO Level 3 Shift" 571 Return the modifier masks corresponding to the "ISO Level 3 Shift"
511 (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
673 734
674 $term->{socket} = ... 735 $term->{socket} = ...
675 $term->{iow} = urxvt::iow 736 $term->{iow} = urxvt::iow
676 ->new 737 ->new
677 ->fd (fileno $term->{socket}) 738 ->fd (fileno $term->{socket})
678 ->events (1) # wait for read data 739 ->events (urxvt::EVENT_READ)
679 ->start 740 ->start
680 ->cb (sub { 741 ->cb (sub {
681 my ($iow, $revents) = @_; 742 my ($iow, $revents) = @_;
682 # $revents must be 1 here, no need to check 743 # $revents must be 1 here, no need to check
683 sysread $term->{socket}, my $buf, 8192 744 sysread $term->{socket}, my $buf, 8192
693 754
694 $iow = $iow->fd ($fd) 755 $iow = $iow->fd ($fd)
695 Set the filedescriptor (not handle) to watch. 756 Set the filedescriptor (not handle) to watch.
696 757
697 $iow = $iow->events ($eventmask) 758 $iow = $iow->events ($eventmask)
698 Set the event mask to watch. Bit #0 (value 1) enables watching 759 Set the event mask to watch. The only allowed values are
699 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".
700 762
701 $iow = $iow->start 763 $iow = $iow->start
702 Start watching for requested events on the given handle. 764 Start watching for requested events on the given handle.
703 765
704 $iow = $iow->stop 766 $iow = $iow->stop

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines