From ae4665191c3f45d16e7ac2d42e31b65df1628937 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 10 Jan 2006 04:23:39 +0000 Subject: [PATCH] *** empty log message *** --- README.FAQ | 2 +- doc/rxvt.1.html | 9 +- doc/rxvt.1.man.in | 10 ++- doc/rxvt.1.txt | 12 ++- doc/rxvt.7.html | 2 +- doc/rxvt.7.man.in | 4 +- doc/rxvt.7.txt | 2 +- doc/rxvtperl.3.html | 157 ++++++++++++++++++++++++++------- doc/rxvtperl.3.man.in | 140 ++++++++++++++++++++--------- doc/rxvtperl.3.txt | 106 +++++++++++++++++----- src/perl/searchable-scrollback | 2 +- src/rxvtc.C | 1 + src/rxvtperl.xs | 5 +- src/urxvt.pm | 15 ++-- 14 files changed, 352 insertions(+), 115 deletions(-) diff --git a/README.FAQ b/README.FAQ index 943de4d5..bf6d2fc7 100644 --- a/README.FAQ +++ b/README.FAQ @@ -37,7 +37,7 @@ FREQUENTLY ASKED QUESTIONS this still fares rather well. And compared to some monsters like gnome-terminal (21152k + extra 4204k in separate processes) or konsole (22200k + extra 43180k in daemons that stay around after - exit, plus half aminute of startup time, including the hundreds of + exit, plus half a minute of startup time, including the hundreds of warnings it spits out), it fares extremely well *g*. Why C++, isn't that unportable/bloated/uncool? diff --git a/doc/rxvt.1.html b/doc/rxvt.1.html index 322a8983..08ca3471 100644 --- a/doc/rxvt.1.html +++ b/doc/rxvt.1.html @@ -1460,12 +1460,19 @@ use in this terminal instance; option -pe.

Extension names can be prefixed with a - sign to prohibit using -it. This can be useful to selectively disable some extensions loaded +them. This can be useful to selectively disable some extensions loaded by default, or specified via the perl-ext-common resource. For example, default,-selection will use all the default extension except selection.

+

Extension names can also be followed by an argument in angle brackets +(e.g. searchable-scrollback<M-s>, which binds the hotkey for +searchable scorllback to Alt/Meta-s). Mentioning the same extension +multiple times with different arguments will pass multiple arguments to +the extension.

+
+

Each extension is looked up in the library directories, loaded if necessary, and bound to the current terminal instance.

diff --git a/doc/rxvt.1.man.in b/doc/rxvt.1.man.in index 27119dd0..b94e7204 100644 --- a/doc/rxvt.1.man.in +++ b/doc/rxvt.1.man.in @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "rxvt 1" -.TH rxvt 1 "2006-01-09" "6.3" "RXVT-UNICODE" +.TH rxvt 1 "2006-01-10" "6.3" "RXVT-UNICODE" .SH "NAME" rxvt\-unicode (ouR XVT, unicode) \- (a VT102 emulator for the X window system) .SH "SYNOPSIS" @@ -1116,11 +1116,17 @@ Comma-separated list(s) of perl extension scripts (default: \f(CW\*(C`default\*( use in this terminal instance; option \fB\-pe\fR. .Sp Extension names can be prefixed with a \f(CW\*(C`\-\*(C'\fR sign to prohibit using -it. This can be useful to selectively disable some extensions loaded +them. This can be useful to selectively disable some extensions loaded by default, or specified via the \f(CW\*(C`perl\-ext\-common\*(C'\fR resource. For example, \f(CW\*(C`default,\-selection\*(C'\fR will use all the default extension except \&\f(CW\*(C`selection\*(C'\fR. .Sp +Extension names can also be followed by an argument in angle brackets +(e.g. \f(CW\*(C`searchable\-scrollback\*(C'\fR, which binds the hotkey for +searchable scorllback to Alt/Meta\-s). Mentioning the same extension +multiple times with different arguments will pass multiple arguments to +the extension. +.Sp Each extension is looked up in the library directories, loaded if necessary, and bound to the current terminal instance. .Sp diff --git a/doc/rxvt.1.txt b/doc/rxvt.1.txt index 45438d79..82f3fe2c 100644 --- a/doc/rxvt.1.txt +++ b/doc/rxvt.1.txt @@ -947,11 +947,17 @@ RESOURCES (available also as long-options) "default") to use in this terminal instance; option -pe. Extension names can be prefixed with a "-" sign to prohibit using - it. This can be useful to selectively disable some extensions loaded - by default, or specified via the "perl-ext-common" resource. For - example, "default,-selection" will use all the default extension + them. This can be useful to selectively disable some extensions + loaded by default, or specified via the "perl-ext-common" resource. + For example, "default,-selection" will use all the default extension except "selection". + Extension names can also be followed by an argument in angle + brackets (e.g. "searchable-scrollback", which binds the hotkey + for searchable scorllback to Alt/Meta-s). Mentioning the same + extension multiple times with different arguments will pass multiple + arguments to the extension. + Each extension is looked up in the library directories, loaded if necessary, and bound to the current terminal instance. diff --git a/doc/rxvt.7.html b/doc/rxvt.7.html index e5771492..70ae2df8 100644 --- a/doc/rxvt.7.html +++ b/doc/rxvt.7.html @@ -122,7 +122,7 @@ memory.

Compared to e.g. Eterm (5112k), aterm (3132k) and xterm (4680k), this still fares rather well. And compared to some monsters like gnome-terminal (21152k + extra 4204k in separate processes) or konsole (22200k + extra -43180k in daemons that stay around after exit, plus half aminute of +43180k in daemons that stay around after exit, plus half a minute of startup time, including the hundreds of warnings it spits out), it fares extremely well *g*.

diff --git a/doc/rxvt.7.man.in b/doc/rxvt.7.man.in index 4afc5002..1cf40b26 100644 --- a/doc/rxvt.7.man.in +++ b/doc/rxvt.7.man.in @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "rxvt 7" -.TH rxvt 7 "2006-01-09" "6.3" "RXVT-UNICODE" +.TH rxvt 7 "2006-01-10" "6.3" "RXVT-UNICODE" .SH "NAME" RXVT REFERENCE \- FAQ, command sequences and other background information .SH "SYNOPSIS" @@ -200,7 +200,7 @@ memory. Compared to e.g. Eterm (5112k), aterm (3132k) and xterm (4680k), this still fares rather well. And compared to some monsters like gnome-terminal (21152k + extra 4204k in separate processes) or konsole (22200k + extra -43180k in daemons that stay around after exit, plus half aminute of +43180k in daemons that stay around after exit, plus half a minute of startup time, including the hundreds of warnings it spits out), it fares extremely well *g*. .IP "Why \*(C+, isn't that unportable/bloated/uncool?" 4 diff --git a/doc/rxvt.7.txt b/doc/rxvt.7.txt index 9ac3292a..054b02e2 100644 --- a/doc/rxvt.7.txt +++ b/doc/rxvt.7.txt @@ -58,7 +58,7 @@ FREQUENTLY ASKED QUESTIONS this still fares rather well. And compared to some monsters like gnome-terminal (21152k + extra 4204k in separate processes) or konsole (22200k + extra 43180k in daemons that stay around after - exit, plus half aminute of startup time, including the hundreds of + exit, plus half a minute of startup time, including the hundreds of warnings it spits out), it fares extremely well *g*. Why C++, isn't that unportable/bloated/uncool? diff --git a/doc/rxvtperl.3.html b/doc/rxvtperl.3.html index e9499e97..3cd2e8c7 100644 --- a/doc/rxvtperl.3.html +++ b/doc/rxvtperl.3.html @@ -19,6 +19,7 @@
  • Prepackaged Extensions
  • General API Considerations
  • +
  • Extension Objects
  • Hooks
  • Variables in the urxvt Package
  • Functions in the urxvt Package
  • @@ -116,6 +117,20 @@ Binds a popup menu to Ctrl-Button3 that lets you convert the selection text into various other formats/action.

    +
    searchable-scrollback<hotkey> (enabled by default)
    +
    +
    +Adds regex search functionality to the scrollback buffer, triggered +by a hotkey (default: M-s). When in search mode, normal terminal +input/output is suspended. +
    +
    +

    / starts an incremental regex search, n searches further, p or +N jump to the previous match, G jumps to the bottom and clears the +history, enter leaves search mode at the current position and escape +returns to the original position.

    +
    +

    digital-clock
    @@ -183,19 +198,49 @@ locale-specific way.

    +

    Extension Objects

    +

    Very perl extension is a perl class. A separate perl object is created +for each terminal and each extension and passed as the first parameter to +hooks. So extensions can use their $self object without having to think +about other extensions, with the exception of methods and members that +begin with an underscore character _: these are reserved for internal +use.

    +

    Although it isn't a urxvt::term object, you can call all methods of the +urxvt::term class on this object.

    +

    It has the following methods and data members:

    +
    +
    $urxvt_term = $self->{term}
    +
    +
    +Returns the urxvt::term object associated with this instance of the +extension. This member must not be changed in any way. +
    +

    +
    $self->enable ($hook_name => $cb, [$hook_name => $cb..])
    +
    +
    +Dynamically enable the given hooks (named without the on_ prefix) for +this extension, replacing any previous hook. This is useful when you want +to overwrite time-critical hooks only temporarily. +
    +

    +
    $self->disable ($hook_name[, $hook_name..])
    +
    +
    +Dynamically disable the given hooks. +
    +

    +

    +

    Hooks

    The following subroutines can be declared in extension files, and will be called whenever the relevant event happens.

    -

    The first argument passed to them is an object private to each terminal -and extension package. You can call all urxvt::term methods on it, but -its not a real urxvt::term object. Instead, the real urxvt::term -object that is shared between all packages is stored in the term -member. It is, however, blessed intot he package of the extension script, -so for all practical purposes you can treat an extension script as a class.

    -

    All of them must return a boolean value. If it is true, then the event -counts as being consumed, and the invocation of other hooks is skipped, -and the relevant action might not be carried out by the C++ code.

    -

    When in doubt, return a false value (preferably ()).

    +

    The first argument passed to them is an extension oject as described in +the in the Extension Objects section.

    +

    All of these hooks must return a boolean value. If it is true, then the +event counts as being consumed, and the invocation of other hooks is +skipped, and the relevant action might not be carried out by the C++ code.

    +

    When in doubt, return a false value (preferably ()). >

    on_init $term
    @@ -304,6 +349,13 @@ might be very slow, however, as your hook is called for all tex output.

    +
    on_tt_write $term, $octets
    +
    +
    +Called whenever some data is written to the tty/pty and can be used to +suppress or filter tty input. +
    +

    on_line_update $term, $row
    @@ -359,9 +411,9 @@ Called wheneever the window loses keyboard focus, before rxvt-unicode does focus out processing.

    -
    on_key_press $term, $event, $octets
    +
    on_key_press $term, $event, $keysym, $octets
    -
    on_key_release $term, $event
    +
    on_key_release $term, $event, $keysym
    on_button_press $term, $event
    @@ -602,6 +654,13 @@ to see the actual list:

    utmpInhibit visualBell

    +
    $success = $term->parse_keysym ($keysym_spec, $command_string)
    +
    +
    +Adds a keymap translation exactly as specified via a resource. See the +keysym resource in the rxvt(1) manpage. +
    +

    $rend = $term->rstyle ([$new_rstyle])
    @@ -639,26 +698,11 @@ by the next method).
    Return the current selection text and optionally replace it by $newtext.
    +

    +
    $term->overlay_simple ($x, $y, $text)
    +
    -

    #=item $term->overlay ($x, $y, $text) -# -#Create a simple multi-line overlay box. See the next method for details. -# -#=cut -# -#sub urxvt::term::scr_overlay { -# my ($self, $x, $y, $text) = @_; -# -# my @lines = split /\n/, $text; -# -# my $w = 0; -# for (map $self->strwidth ($_), @lines) { -# $w = $_ if $w < $_; -# } -# -# $self->scr_overlay_new ($x, $y, $w, scalar @lines); -# $self->scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines; -#}

    +Create a simple multi-line overlay box. See the next method for details.

    $term->overlay ($x, $y, $width, $height[, $rstyle[, $border]])
    @@ -731,6 +775,29 @@ Convert the given text string into the corresponding locale encoding. Convert the given locale-encoded octets into a perl string.

    +
    $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle])
    +
    +
    +XORs the rendition values in the given span with the provided value +(default: RS_RVid). Useful in refresh hooks to provide effects similar +to the selection. +
    +

    +
    $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, $rstyle2]])
    +
    +
    +Similar to scr_xor_span, but xors a rectangle instead. Trailing +whitespace will additionally be xored with the $rstyle2, which defaults +to RS_RVid | RS_Uline, which removes reverse video again and underlines +it instead. +
    +

    +
    $term->scr_bell
    +
    +
    +Ring the bell! +
    +

    $term->scr_add_lines ($string)
    @@ -761,6 +828,15 @@ pass characters instead of octets, you should convert your strings first to the locale-specific encoding using $term->locale_encode.

    +
    $old_events = $term->pty_ev_events ([$new_events])
    +
    +
    +Replaces the event mask of the pty watcher by the given event mask. Can +be used to suppress input and output handling to the pty/tty. See the +description of urxvt::timer->events. Make sure to always restore +the previous value. +
    +

    $windowid = $term->parent
    @@ -801,6 +877,18 @@ Return the window id of the terminal window. Return various integers describing terminal characteristics.

    +
    $lc_ctype = $term->locale
    +
    +
    +Returns the LC_CTYPE category string used by this rxvt-unicode. +
    +

    +
    $x_display = $term->display_id
    +
    +
    +Return the DISPLAY used by rxvt-unicode. +
    +

    $modifiermask = $term->ModLevel3Mask
    $modifiermask = $term->ModMetaMask
    @@ -1074,7 +1162,7 @@ Stop the timer. $term->{iow} = urxvt::iow ->new ->fd (fileno $term->{socket}) - ->events (1) # wait for read data + ->events (urxvt::EVENT_READ) ->start ->cb (sub { my ($iow, $revents) = @_; @@ -1105,8 +1193,9 @@ Set the filedescriptor (not handle) to watch.
    $iow = $iow->events ($eventmask)
    -Set the event mask to watch. Bit #0 (value 1) enables watching for read -data, Bit #1 (value 2) enables watching for write data. +Set the event mask to watch. The only allowed values are +urxvt::EVENT_READ and urxvt::EVENT_WRITE, which might be ORed +together, or urxvt::EVENT_NONE.

    $iow = $iow->start
    diff --git a/doc/rxvtperl.3.man.in b/doc/rxvtperl.3.man.in index 7fb87dd6..2597fb98 100644 --- a/doc/rxvtperl.3.man.in +++ b/doc/rxvtperl.3.man.in @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "rxvt 3" -.TH rxvt 3 "2006-01-09" "6.3" "RXVT-UNICODE" +.TH rxvt 3 "2006-01-10" "6.3" "RXVT-UNICODE" .SH "NAME" @@RXVT_NAME@@perl \- rxvt\-unicode's embedded perl interpreter .SH "SYNOPSIS" @@ -199,6 +199,16 @@ runtime. .IX Item "selection-popup (enabled by default)" Binds a popup menu to Ctrl\-Button3 that lets you convert the selection text into various other formats/action. +.IP "searchable\-scrollback (enabled by default)" 4 +.IX Item "searchable-scrollback (enabled by default)" +Adds regex search functionality to the scrollback buffer, triggered +by a hotkey (default: \f(CW\*(C`M\-s\*(C'\fR). When in search mode, normal terminal +input/output is suspended. +.Sp +\&\f(CW\*(C`/\*(C'\fR starts an incremental regex search, \f(CW\*(C`n\*(C'\fR searches further, \f(CW\*(C`p\*(C'\fR or +\&\f(CW\*(C`N\*(C'\fR jump to the previous match, \f(CW\*(C`G\*(C'\fR jumps to the bottom and clears the +history, \f(CW\*(C`enter\*(C'\fR leaves search mode at the current position and \f(CW\*(C`escape\*(C'\fR +returns to the original position. .IP "digital-clock" 4 .IX Item "digital-clock" Displays a digital clock using the built-in overlay. @@ -243,23 +253,47 @@ encoding (often locale\-specific) and binary data. .IX Item "$octets" Either binary data or \- more common \- a text string encoded in a locale-specific way. +.Sh "Extension Objects" +.IX Subsection "Extension Objects" +Very perl extension is a perl class. A separate perl object is created +for each terminal and each extension and passed as the first parameter to +hooks. So extensions can use their \f(CW$self\fR object without having to think +about other extensions, with the exception of methods and members that +begin with an underscore character \f(CW\*(C`_\*(C'\fR: these are reserved for internal +use. +.PP +Although it isn't a \f(CW\*(C`urxvt::term\*(C'\fR object, you can call all methods of the +\&\f(CW\*(C`urxvt::term\*(C'\fR class on this object. +.PP +It has the following methods and data members: +.ie n .IP "$urxvt_term = $self\->{term}" 4 +.el .IP "$urxvt_term = \f(CW$self\fR\->{term}" 4 +.IX Item "$urxvt_term = $self->{term}" +Returns the \f(CW\*(C`urxvt::term\*(C'\fR object associated with this instance of the +extension. This member \fImust not\fR be changed in any way. +.ie n .IP "$self\->enable ($hook_name => $cb\fR, [$hook_name => \f(CW$cb..])" 4 +.el .IP "$self\->enable ($hook_name => \f(CW$cb\fR, [$hook_name => \f(CW$cb\fR..])" 4 +.IX Item "$self->enable ($hook_name => $cb, [$hook_name => $cb..])" +Dynamically enable the given hooks (named without the \f(CW\*(C`on_\*(C'\fR prefix) for +this extension, replacing any previous hook. This is useful when you want +to overwrite time-critical hooks only temporarily. +.ie n .IP "$self\->disable ($hook_name[, $hook_name..])" 4 +.el .IP "$self\->disable ($hook_name[, \f(CW$hook_name\fR..])" 4 +.IX Item "$self->disable ($hook_name[, $hook_name..])" +Dynamically disable the given hooks. .Sh "Hooks" .IX Subsection "Hooks" The following subroutines can be declared in extension files, and will be called whenever the relevant event happens. .PP -The first argument passed to them is an object private to each terminal -and extension package. You can call all \f(CW\*(C`urxvt::term\*(C'\fR methods on it, but -its not a real \f(CW\*(C`urxvt::term\*(C'\fR object. Instead, the real \f(CW\*(C`urxvt::term\*(C'\fR -object that is shared between all packages is stored in the \f(CW\*(C`term\*(C'\fR -member. It is, however, blessed intot he package of the extension script, -so for all practical purposes you can treat an extension script as a class. +The first argument passed to them is an extension oject as described in +the in the \f(CW\*(C`Extension Objects\*(C'\fR section. .PP -All of them must return a boolean value. If it is true, then the event -counts as being \fIconsumed\fR, and the invocation of other hooks is skipped, -and the relevant action might not be carried out by the \*(C+ code. +\&\fBAll\fR of these hooks must return a boolean value. If it is true, then the +event counts as being \fIconsumed\fR, and the invocation of other hooks is +skipped, and the relevant action might not be carried out by the \*(C+ code. .PP -When in doubt, return a false value (preferably \f(CW\*(C`()\*(C'\fR). +\&\fIWhen in doubt, return a false value (preferably \f(CI\*(C`()\*(C'\fI).\fR .ie n .IP "on_init $term" 4 .el .IP "on_init \f(CW$term\fR" 4 .IX Item "on_init $term" @@ -342,6 +376,11 @@ can filter/change and output the text yourself by returning a true value and calling \f(CW\*(C`$term\->scr_add_lines\*(C'\fR yourself. Please note that this might be very slow, however, as your hook is called for \fBall\fR text being output. +.ie n .IP "on_tt_write $term\fR, \f(CW$octets" 4 +.el .IP "on_tt_write \f(CW$term\fR, \f(CW$octets\fR" 4 +.IX Item "on_tt_write $term, $octets" +Called whenever some data is written to the tty/pty and can be used to +suppress or filter tty input. .ie n .IP "on_line_update $term\fR, \f(CW$row" 4 .el .IP "on_line_update \f(CW$term\fR, \f(CW$row\fR" 4 .IX Item "on_line_update $term, $row" @@ -383,13 +422,13 @@ does focus in processing. .IX Item "on_focus_out $term" Called wheneever the window loses keyboard focus, before rxvt-unicode does focus out processing. -.ie n .IP "on_key_press $term\fR, \f(CW$event\fR, \f(CW$octets" 4 -.el .IP "on_key_press \f(CW$term\fR, \f(CW$event\fR, \f(CW$octets\fR" 4 -.IX Item "on_key_press $term, $event, $octets" +.ie n .IP "on_key_press $term\fR, \f(CW$event\fR, \f(CW$keysym\fR, \f(CW$octets" 4 +.el .IP "on_key_press \f(CW$term\fR, \f(CW$event\fR, \f(CW$keysym\fR, \f(CW$octets\fR" 4 +.IX Item "on_key_press $term, $event, $keysym, $octets" .PD 0 -.ie n .IP "on_key_release $term\fR, \f(CW$event" 4 -.el .IP "on_key_release \f(CW$term\fR, \f(CW$event\fR" 4 -.IX Item "on_key_release $term, $event" +.ie n .IP "on_key_release $term\fR, \f(CW$event\fR, \f(CW$keysym" 4 +.el .IP "on_key_release \f(CW$term\fR, \f(CW$event\fR, \f(CW$keysym\fR" 4 +.IX Item "on_key_release $term, $event, $keysym" .ie n .IP "on_button_press $term\fR, \f(CW$event" 4 .el .IP "on_button_press \f(CW$term\fR, \f(CW$event\fR" 4 .IX Item "on_button_press $term, $event" @@ -581,6 +620,11 @@ to see the actual list: \& shade term_name title transparent transparent_all tripleclickwords \& utmpInhibit visualBell .Ve +.ie n .IP "$success = $term\fR\->parse_keysym ($keysym_spec, \f(CW$command_string)" 4 +.el .IP "$success = \f(CW$term\fR\->parse_keysym ($keysym_spec, \f(CW$command_string\fR)" 4 +.IX Item "$success = $term->parse_keysym ($keysym_spec, $command_string)" +Adds a keymap translation exactly as specified via a resource. See the +\&\f(CW\*(C`keysym\*(C'\fR resource in the @@RXVT_NAME@@(1) manpage. .ie n .IP "$rend = $term\->rstyle ([$new_rstyle])" 4 .el .IP "$rend = \f(CW$term\fR\->rstyle ([$new_rstyle])" 4 .IX Item "$rend = $term->rstyle ([$new_rstyle])" @@ -613,26 +657,10 @@ by the next method). .el .IP "$oldtext = \f(CW$term\fR\->selection ([$newtext])" 4 .IX Item "$oldtext = $term->selection ([$newtext])" Return the current selection text and optionally replace it by \f(CW$newtext\fR. -.Sp -#=item \f(CW$term\fR\->overlay ($x, \f(CW$y\fR, \f(CW$text\fR) -# -#Create a simple multi-line overlay box. See the next method for details. -# -#=cut -# -#sub urxvt::term::scr_overlay { -# my ($self, \f(CW$x\fR, \f(CW$y\fR, \f(CW$text\fR) = \f(CW@_\fR; -# -# my \f(CW@lines\fR = split /\en/, \f(CW$text\fR; -# -# my \f(CW$w\fR = 0; -# for (map \f(CW$self\fR\->strwidth ($_), \f(CW@lines\fR) { -# \f(CW$w\fR = \f(CW$_\fR if \f(CW$w\fR < \f(CW$_\fR; -# } -# -# \f(CW$self\fR\->scr_overlay_new ($x, \f(CW$y\fR, \f(CW$w\fR, scalar \f(CW@lines\fR); -# \f(CW$self\fR\->scr_overlay_set (0, \f(CW$_\fR, \f(CW$lines\fR[$_]) for 0.. $#lines; -#} +.ie n .IP "$term\->overlay_simple ($x, $y\fR, \f(CW$text)" 4 +.el .IP "$term\->overlay_simple ($x, \f(CW$y\fR, \f(CW$text\fR)" 4 +.IX Item "$term->overlay_simple ($x, $y, $text)" +Create a simple multi-line overlay box. See the next method for details. .ie n .IP "$term\->overlay ($x, $y\fR, \f(CW$width\fR, \f(CW$height\fR[, \f(CW$rstyle\fR[, \f(CW$border]])" 4 .el .IP "$term\->overlay ($x, \f(CW$y\fR, \f(CW$width\fR, \f(CW$height\fR[, \f(CW$rstyle\fR[, \f(CW$border\fR]])" 4 .IX Item "$term->overlay ($x, $y, $width, $height[, $rstyle[, $border]])" @@ -685,6 +713,22 @@ Convert the given text string into the corresponding locale encoding. .el .IP "$string = \f(CW$term\fR\->locale_decode ($octets)" 4 .IX Item "$string = $term->locale_decode ($octets)" Convert the given locale-encoded octets into a perl string. +.ie n .IP "$term\->scr_xor_span ($beg_row, $beg_col\fR, \f(CW$end_row\fR, \f(CW$end_col\fR[, \f(CW$rstyle])" 4 +.el .IP "$term\->scr_xor_span ($beg_row, \f(CW$beg_col\fR, \f(CW$end_row\fR, \f(CW$end_col\fR[, \f(CW$rstyle\fR])" 4 +.IX Item "$term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle])" +XORs the rendition values in the given span with the provided value +(default: \f(CW\*(C`RS_RVid\*(C'\fR). Useful in refresh hooks to provide effects similar +to the selection. +.ie n .IP "$term\->scr_xor_rect ($beg_row, $beg_col\fR, \f(CW$end_row\fR, \f(CW$end_col\fR[, \f(CW$rstyle1\fR[, \f(CW$rstyle2]])" 4 +.el .IP "$term\->scr_xor_rect ($beg_row, \f(CW$beg_col\fR, \f(CW$end_row\fR, \f(CW$end_col\fR[, \f(CW$rstyle1\fR[, \f(CW$rstyle2\fR]])" 4 +.IX Item "$term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, $rstyle2]])" +Similar to \f(CW\*(C`scr_xor_span\*(C'\fR, but xors a rectangle instead. Trailing +whitespace will additionally be xored with the \f(CW$rstyle2\fR, which defaults +to \f(CW\*(C`RS_RVid | RS_Uline\*(C'\fR, which removes reverse video again and underlines +it instead. +.IP "$term\->scr_bell" 4 +.IX Item "$term->scr_bell" +Ring the bell! .IP "$term\->scr_add_lines ($string)" 4 .IX Item "$term->scr_add_lines ($string)" Write the given text string to the screen, as if output by the application @@ -705,6 +749,13 @@ locale-specific encoding of the terminal and can contain command sequences Write the octets given in \f(CW$data\fR to the tty (i.e. as program input). To pass characters instead of octets, you should convert your strings first to the locale-specific encoding using \f(CW\*(C`$term\->locale_encode\*(C'\fR. +.ie n .IP "$old_events = $term\->pty_ev_events ([$new_events])" 4 +.el .IP "$old_events = \f(CW$term\fR\->pty_ev_events ([$new_events])" 4 +.IX Item "$old_events = $term->pty_ev_events ([$new_events])" +Replaces the event mask of the pty watcher by the given event mask. Can +be used to suppress input and output handling to the pty/tty. See the +description of \f(CW\*(C`urxvt::timer\->events\*(C'\fR. Make sure to always restore +the previous value. .ie n .IP "$windowid = $term\->parent" 4 .el .IP "$windowid = \f(CW$term\fR\->parent" 4 .IX Item "$windowid = $term->parent" @@ -752,6 +803,14 @@ Return the window id of the terminal window. .IX Item "$lines_in_scrollback = $term->nsaved" .PD Return various integers describing terminal characteristics. +.ie n .IP "$lc_ctype = $term\->locale" 4 +.el .IP "$lc_ctype = \f(CW$term\fR\->locale" 4 +.IX Item "$lc_ctype = $term->locale" +Returns the \s-1LC_CTYPE\s0 category string used by this rxvt\-unicode. +.ie n .IP "$x_display = $term\->display_id" 4 +.el .IP "$x_display = \f(CW$term\fR\->display_id" 4 +.IX Item "$x_display = $term->display_id" +Return the \s-1DISPLAY\s0 used by rxvt\-unicode. .ie n .IP "$modifiermask = $term\->ModLevel3Mask" 4 .el .IP "$modifiermask = \f(CW$term\fR\->ModLevel3Mask" 4 .IX Item "$modifiermask = $term->ModLevel3Mask" @@ -968,7 +1027,7 @@ This class implements io watchers/events. Example: \& $term->{iow} = urxvt::iow \& ->new \& ->fd (fileno $term->{socket}) -\& ->events (1) # wait for read data +\& ->events (urxvt::EVENT_READ) \& ->start \& ->cb (sub { \& my ($iow, $revents) = @_; @@ -992,8 +1051,9 @@ Set the filedescriptor (not handle) to watch. .ie n .IP "$iow = $iow\->events ($eventmask)" 4 .el .IP "$iow = \f(CW$iow\fR\->events ($eventmask)" 4 .IX Item "$iow = $iow->events ($eventmask)" -Set the event mask to watch. Bit #0 (value \f(CW1\fR) enables watching for read -data, Bit #1 (value \f(CW2\fR) enables watching for write data. +Set the event mask to watch. The only allowed values are +\&\f(CW\*(C`urxvt::EVENT_READ\*(C'\fR and \f(CW\*(C`urxvt::EVENT_WRITE\*(C'\fR, which might be ORed +together, or \f(CW\*(C`urxvt::EVENT_NONE\*(C'\fR. .ie n .IP "$iow = $iow\->start" 4 .el .IP "$iow = \f(CW$iow\fR\->start" 4 .IX Item "$iow = $iow->start" diff --git a/doc/rxvtperl.3.txt b/doc/rxvtperl.3.txt index 1ecff564..57a4b2b2 100644 --- a/doc/rxvtperl.3.txt +++ b/doc/rxvtperl.3.txt @@ -52,6 +52,16 @@ DESCRIPTION Binds a popup menu to Ctrl-Button3 that lets you convert the selection text into various other formats/action. + searchable-scrollback (enabled by default) + Adds regex search functionality to the scrollback buffer, triggered + by a hotkey (default: "M-s"). When in search mode, normal terminal + input/output is suspended. + + "/" starts an incremental regex search, "n" searches further, "p" or + "N" jump to the previous match, "G" jumps to the bottom and clears + the history, "enter" leaves search mode at the current position and + "escape" returns to the original position. + digital-clock Displays a digital clock using the built-in overlay. @@ -98,24 +108,44 @@ DESCRIPTION Either binary data or - more common - a text string encoded in a locale-specific way. + Extension Objects + Very perl extension is a perl class. A separate perl object is created + for each terminal and each extension and passed as the first parameter + to hooks. So extensions can use their $self object without having to + think about other extensions, with the exception of methods and members + that begin with an underscore character "_": these are reserved for + internal use. + + Although it isn't a "urxvt::term" object, you can call all methods of + the "urxvt::term" class on this object. + + It has the following methods and data members: + + $urxvt_term = $self->{term} + Returns the "urxvt::term" object associated with this instance of + the extension. This member *must not* be changed in any way. + + $self->enable ($hook_name => $cb, [$hook_name => $cb..]) + Dynamically enable the given hooks (named without the "on_" prefix) + for this extension, replacing any previous hook. This is useful when + you want to overwrite time-critical hooks only temporarily. + + $self->disable ($hook_name[, $hook_name..]) + Dynamically disable the given hooks. + Hooks The following subroutines can be declared in extension files, and will be called whenever the relevant event happens. - The first argument passed to them is an object private to each terminal - and extension package. You can call all "urxvt::term" methods on it, but - its not a real "urxvt::term" object. Instead, the real "urxvt::term" - object that is shared between all packages is stored in the "term" - member. It is, however, blessed intot he package of the extension - script, so for all practical purposes you can treat an extension script - as a class. + The first argument passed to them is an extension oject as described in + the in the "Extension Objects" section. - All of them must return a boolean value. If it is true, then the event - counts as being *consumed*, and the invocation of other hooks is + All of these hooks must return a boolean value. If it is true, then the + event counts as being *consumed*, and the invocation of other hooks is skipped, and the relevant action might not be carried out by the C++ code. - When in doubt, return a false value (preferably "()"). + *When in doubt, return a false value (preferably "()").* on_init $term Called after a new terminal object has been initialized, but before @@ -191,6 +221,10 @@ DESCRIPTION Please note that this might be very slow, however, as your hook is called for all text being output. + on_tt_write $term, $octets + Called whenever some data is written to the tty/pty and can be used + to suppress or filter tty input. + on_line_update $term, $row Called whenever a line was updated or changed. Can be used to filter screen output (e.g. underline urls or other useless stuff). Only @@ -227,8 +261,8 @@ DESCRIPTION Called wheneever the window loses keyboard focus, before rxvt-unicode does focus out processing. - on_key_press $term, $event, $octets - on_key_release $term, $event + on_key_press $term, $event, $keysym, $octets + on_key_release $term, $event, $keysym on_button_press $term, $event on_button_release $term, $event on_motion_notify $term, $event @@ -388,6 +422,10 @@ DESCRIPTION shade term_name title transparent transparent_all tripleclickwords utmpInhibit visualBell + $success = $term->parse_keysym ($keysym_spec, $command_string) + Adds a keymap translation exactly as specified via a resource. See + the "keysym" resource in the rxvt(1) manpage. + $rend = $term->rstyle ([$new_rstyle]) Return and optionally change the current rendition. Text that is output by the terminal application will use this style. @@ -411,13 +449,9 @@ DESCRIPTION Return the current selection text and optionally replace it by $newtext. - #=item $term->overlay ($x, $y, $text) # #Create a simple multi-line - overlay box. See the next method for details. # #=cut # #sub - urxvt::term::scr_overlay { # my ($self, $x, $y, $text) = @_; # # my - @lines = split /\n/, $text; # # my $w = 0; # for (map - $self->strwidth ($_), @lines) { # $w = $_ if $w < $_; # } # # - $self->scr_overlay_new ($x, $y, $w, scalar @lines); # - $self->scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines; #} + $term->overlay_simple ($x, $y, $text) + Create a simple multi-line overlay box. See the next method for + details. $term->overlay ($x, $y, $width, $height[, $rstyle[, $border]]) Create a new (empty) overlay at the given position with the given @@ -462,6 +496,21 @@ DESCRIPTION $string = $term->locale_decode ($octets) Convert the given locale-encoded octets into a perl string. + $term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle]) + XORs the rendition values in the given span with the provided value + (default: "RS_RVid"). Useful in refresh hooks to provide effects + similar to the selection. + + $term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, + $rstyle2]]) + Similar to "scr_xor_span", but xors a rectangle instead. Trailing + whitespace will additionally be xored with the $rstyle2, which + defaults to "RS_RVid | RS_Uline", which removes reverse video again + and underlines it instead. + + $term->scr_bell + Ring the bell! + $term->scr_add_lines ($string) Write the given text string to the screen, as if output by the application running inside the terminal. It may not contain command @@ -484,6 +533,12 @@ DESCRIPTION strings first to the locale-specific encoding using "$term->locale_encode". + $old_events = $term->pty_ev_events ([$new_events]) + Replaces the event mask of the pty watcher by the given event mask. + Can be used to suppress input and output handling to the pty/tty. + See the description of "urxvt::timer->events". Make sure to always + restore the previous value. + $windowid = $term->parent Return the window id of the toplevel window. @@ -504,6 +559,12 @@ DESCRIPTION $lines_in_scrollback = $term->nsaved Return various integers describing terminal characteristics. + $lc_ctype = $term->locale + Returns the LC_CTYPE category string used by this rxvt-unicode. + + $x_display = $term->display_id + Return the DISPLAY used by rxvt-unicode. + $modifiermask = $term->ModLevel3Mask $modifiermask = $term->ModMetaMask $modifiermask = $term->ModNumLockMask @@ -675,7 +736,7 @@ DESCRIPTION $term->{iow} = urxvt::iow ->new ->fd (fileno $term->{socket}) - ->events (1) # wait for read data + ->events (urxvt::EVENT_READ) ->start ->cb (sub { my ($iow, $revents) = @_; @@ -695,8 +756,9 @@ DESCRIPTION Set the filedescriptor (not handle) to watch. $iow = $iow->events ($eventmask) - Set the event mask to watch. Bit #0 (value 1) enables watching - for read data, Bit #1 (value 2) enables watching for write data. + Set the event mask to watch. The only allowed values are + "urxvt::EVENT_READ" and "urxvt::EVENT_WRITE", which might be + ORed together, or "urxvt::EVENT_NONE". $iow = $iow->start Start watching for requested events on the given handle. diff --git a/src/perl/searchable-scrollback b/src/perl/searchable-scrollback index 428415f5..96f385d3 100644 --- a/src/perl/searchable-scrollback +++ b/src/perl/searchable-scrollback @@ -46,7 +46,7 @@ sub enter { ); $self->{manpage_overlay} = $self->overlay (0, -2, $self->ncol, 1, urxvt::OVERLAY_RSTYLE, 0); - $self->{manpage_overlay}->set (0, 0, "scrollback search, see man ${urxvt::RXVTNAME}perl for details"); + $self->{manpage_overlay}->set (0, 0, "scrollback search, see the ${urxvt::RXVTNAME}perl manpage for details"); $self->idle; } diff --git a/src/rxvtc.C b/src/rxvtc.C index 0b00b357..e49bb203 100644 --- a/src/rxvtc.C +++ b/src/rxvtc.C @@ -123,6 +123,7 @@ main (int argc, const char *const *argv) else if (!strcmp (tok, "END")) { int success; + if (c.recv (success)) exit (success ? EXIT_SUCCESS : EXIT_FAILURE); } diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs index 88e775f8..4b6e6ebe 100644 --- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -629,7 +629,10 @@ PROTOTYPES: ENABLE BOOT: { - sv_setsv (get_sv ("urxvt::LIBDIR", 1), newSVpvn (LIBDIR, sizeof (LIBDIR) - 1)); + sv_setsv (get_sv ("urxvt::LIBDIR", 1), newSVpvn (LIBDIR, sizeof (LIBDIR) - 1)); + sv_setsv (get_sv ("urxvt::RESNAME", 1), newSVpvn (RESNAME, sizeof (RESNAME) - 1)); + sv_setsv (get_sv ("urxvt::RESCLASS", 1), newSVpvn (RESCLASS, sizeof (RESCLASS) - 1)); + sv_setsv (get_sv ("urxvt::RXVTNAME", 1), newSVpvn (RXVTNAME, sizeof (RXVTNAME) - 1)); AV *hookname = get_av ("urxvt::HOOKNAME", 1); # define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); diff --git a/src/urxvt.pm b/src/urxvt.pm index 0f286b15..e3ccecdf 100644 --- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -68,13 +68,16 @@ runtime. Binds a popup menu to Ctrl-Button3 that lets you convert the selection text into various other formats/action. -=item searchable-scrollback (enabled by default) +=item searchable-scrollback (enabled by default) -Adds regex search functionality to the scrollback buffer, triggered by a -hotkey (default: C). When in search mode, terminal input/output is -suspended, C starts an incremental regex search, C searches further, -C

    jumps to the previous match. C leaves search mode at the -current position and C returns to the original position. +Adds regex search functionality to the scrollback buffer, triggered +by a hotkey (default: C). When in search mode, normal terminal +input/output is suspended. + +C starts an incremental regex search, C searches further, C

    or +C jump to the previous match, C jumps to the bottom and clears the +history, C leaves search mode at the current position and C +returns to the original position. =item digital-clock -- 2.34.1