--- rxvt-unicode/src/urxvt.pm 2008/06/15 13:54:15 1.167 +++ rxvt-unicode/src/urxvt.pm 2008/10/10 00:21:15 1.172 @@ -110,7 +110,7 @@ first argument. The following will add an entry C that changes -C<$self->{myoption}>: +C<< $self->{myoption} >>: push @{ $self->{term}{option_popup_hook} }, sub { ("my option" => $myoption, sub { $self->{myoption} = $_[0] }) @@ -543,29 +543,42 @@ $nrow - 1) represent the lines to be scrolled out). C<$saved> is the total number of lines that will be in the scrollback buffer. -=item on_osc_seq $term, $op, $args +=item on_osc_seq $term, $op, $args, $resp Called on every OSC sequence and can be used to suppress it or modify its -behaviour. The default should be to return an empty list. A true value +behaviour. The default should be to return an empty list. A true value suppresses execution of the request completely. Make sure you don't get -confused by recursive invocations when you output an osc sequence within +confused by recursive invocations when you output an OSC sequence within this callback. C should be used for new behaviour. -=item on_osc_seq_perl $term, $string +=item on_osc_seq_perl $term, $args, $resp Called whenever the B command sequence (OSC = operating system command) is processed. Cursor position and other state information is up-to-date when this happens. For interoperability, the -string should start with the extension name and a colon, to distinguish -it from commands for other extensions, and this might be enforced in the -future. +string should start with the extension name (sans -osc) and a semicolon, +to distinguish it from commands for other extensions, and this might be +enforced in the future. + +For example, C uses this: + + sub on_osc_seq_perl { + my ($self, $osc, $resp) = @_; + + return unless $osc =~ s/^overlay;//; + + ... process remaining $osc string + } Be careful not ever to trust (in a security sense) the data you receive, as its source can not easily be controlled (e-mail content, messages from other users on the same system etc.). +For responses, C<$resp> contains the end-of-args separator used by the +sender. + =item on_add_lines $term, $string Called whenever text is about to be output, with the text as argument. You @@ -595,8 +608,8 @@ =item on_refresh_begin $term -Called just before the screen gets redrawn. Can be used for overlay -or similar effects by modify terminal contents in refresh_begin, and +Called just before the screen gets redrawn. Can be used for overlay or +similar effects by modifying the terminal contents in refresh_begin, and restoring them in refresh_end. The built-in overlay and selection display code is run after this hook, and takes precedence. @@ -1282,7 +1295,7 @@ sub resource($$;$) { my ($self, $name) = (shift, shift); unshift @_, $self, $name, ($name =~ s/\s*\+\s*(\d+)$// ? $1 : 0); - &urxvt::term::_resource + goto &urxvt::term::_resource } =item $value = $term->x_resource ($pattern) @@ -1375,12 +1388,14 @@ =over 4 -=item $overlay->set ($x, $y, $text, $rend) +=item $overlay->set ($x, $y, $text[, $rend]) Similar to C<< $term->ROW_t >> and C<< $term->ROW_r >> in that it puts text in rxvt-unicode's special encoding and an array of rendition values at a specific position inside the overlay. +If C<$rend> is missing, then the rendition will not be changed. + =item $overlay->hide If visible, hide the overlay, but do not destroy it. @@ -1809,7 +1824,7 @@ =item ($type,$format,$octets) = $term->XGetWindowProperty ($window, $property) -=item $term->XChangeWindowProperty ($window, $property, $type, $format, $octets) +=item $term->XChangeProperty ($window, $property, $type, $format, $octets) =item $term->XDeleteProperty ($window, $property)