… | |
… | |
108 | reference. The string will be used as button text and the code reference |
108 | reference. The string will be used as button text and the code reference |
109 | will be called when the toggle changes, with the new boolean value as |
109 | will be called when the toggle changes, with the new boolean value as |
110 | first argument. |
110 | first argument. |
111 | |
111 | |
112 | The following will add an entry C<myoption> that changes |
112 | The following will add an entry C<myoption> that changes |
113 | C<$self->{myoption}>: |
113 | C<< $self->{myoption} >>: |
114 | |
114 | |
115 | push @{ $self->{term}{option_popup_hook} }, sub { |
115 | push @{ $self->{term}{option_popup_hook} }, sub { |
116 | ("my option" => $myoption, sub { $self->{myoption} = $_[0] }) |
116 | ("my option" => $myoption, sub { $self->{myoption} = $_[0] }) |
117 | }; |
117 | }; |
118 | |
118 | |
… | |
… | |
541 | |
541 | |
542 | It is called before lines are scrolled out (so rows 0 .. min ($lines - 1, |
542 | It is called before lines are scrolled out (so rows 0 .. min ($lines - 1, |
543 | $nrow - 1) represent the lines to be scrolled out). C<$saved> is the total |
543 | $nrow - 1) represent the lines to be scrolled out). C<$saved> is the total |
544 | number of lines that will be in the scrollback buffer. |
544 | number of lines that will be in the scrollback buffer. |
545 | |
545 | |
546 | =item on_osc_seq $term, $op, $args |
546 | =item on_osc_seq $term, $op, $args, $resp |
547 | |
547 | |
548 | Called on every OSC sequence and can be used to suppress it or modify its |
548 | Called on every OSC sequence and can be used to suppress it or modify its |
549 | behaviour. The default should be to return an empty list. A true value |
549 | behaviour. The default should be to return an empty list. A true value |
550 | suppresses execution of the request completely. Make sure you don't get |
550 | suppresses execution of the request completely. Make sure you don't get |
551 | confused by recursive invocations when you output an osc sequence within |
551 | confused by recursive invocations when you output an OSC sequence within |
552 | this callback. |
552 | this callback. |
553 | |
553 | |
554 | C<on_osc_seq_perl> should be used for new behaviour. |
554 | C<on_osc_seq_perl> should be used for new behaviour. |
555 | |
555 | |
556 | =item on_osc_seq_perl $term, $string |
556 | =item on_osc_seq_perl $term, $args, $resp |
557 | |
557 | |
558 | Called whenever the B<ESC ] 777 ; string ST> command sequence (OSC = |
558 | Called whenever the B<ESC ] 777 ; string ST> command sequence (OSC = |
559 | operating system command) is processed. Cursor position and other state |
559 | operating system command) is processed. Cursor position and other state |
560 | information is up-to-date when this happens. For interoperability, the |
560 | information is up-to-date when this happens. For interoperability, the |
561 | string should start with the extension name and a colon, to distinguish |
561 | string should start with the extension name (sans -osc) and a semicolon, |
562 | it from commands for other extensions, and this might be enforced in the |
562 | to distinguish it from commands for other extensions, and this might be |
563 | future. |
563 | enforced in the future. |
|
|
564 | |
|
|
565 | For example, C<overlay-osc> uses this: |
|
|
566 | |
|
|
567 | sub on_osc_seq_perl { |
|
|
568 | my ($self, $osc, $resp) = @_; |
|
|
569 | |
|
|
570 | return unless $osc =~ s/^overlay;//; |
|
|
571 | |
|
|
572 | ... process remaining $osc string |
|
|
573 | } |
564 | |
574 | |
565 | Be careful not ever to trust (in a security sense) the data you receive, |
575 | Be careful not ever to trust (in a security sense) the data you receive, |
566 | as its source can not easily be controlled (e-mail content, messages from |
576 | as its source can not easily be controlled (e-mail content, messages from |
567 | other users on the same system etc.). |
577 | other users on the same system etc.). |
|
|
578 | |
|
|
579 | For responses, C<$resp> contains the end-of-args separator used by the |
|
|
580 | sender. |
568 | |
581 | |
569 | =item on_add_lines $term, $string |
582 | =item on_add_lines $term, $string |
570 | |
583 | |
571 | Called whenever text is about to be output, with the text as argument. You |
584 | Called whenever text is about to be output, with the text as argument. You |
572 | can filter/change and output the text yourself by returning a true value |
585 | can filter/change and output the text yourself by returning a true value |
… | |
… | |
593 | later with the already-modified line (e.g. if unrelated parts change), so |
606 | later with the already-modified line (e.g. if unrelated parts change), so |
594 | you cannot just toggle rendition bits, but only set them. |
607 | you cannot just toggle rendition bits, but only set them. |
595 | |
608 | |
596 | =item on_refresh_begin $term |
609 | =item on_refresh_begin $term |
597 | |
610 | |
598 | Called just before the screen gets redrawn. Can be used for overlay |
611 | Called just before the screen gets redrawn. Can be used for overlay or |
599 | or similar effects by modify terminal contents in refresh_begin, and |
612 | similar effects by modifying the terminal contents in refresh_begin, and |
600 | restoring them in refresh_end. The built-in overlay and selection display |
613 | restoring them in refresh_end. The built-in overlay and selection display |
601 | code is run after this hook, and takes precedence. |
614 | code is run after this hook, and takes precedence. |
602 | |
615 | |
603 | =item on_refresh_end $term |
616 | =item on_refresh_end $term |
604 | |
617 | |
… | |
… | |
1280 | =cut |
1293 | =cut |
1281 | |
1294 | |
1282 | sub resource($$;$) { |
1295 | sub resource($$;$) { |
1283 | my ($self, $name) = (shift, shift); |
1296 | my ($self, $name) = (shift, shift); |
1284 | unshift @_, $self, $name, ($name =~ s/\s*\+\s*(\d+)$// ? $1 : 0); |
1297 | unshift @_, $self, $name, ($name =~ s/\s*\+\s*(\d+)$// ? $1 : 0); |
1285 | &urxvt::term::_resource |
1298 | goto &urxvt::term::_resource |
1286 | } |
1299 | } |
1287 | |
1300 | |
1288 | =item $value = $term->x_resource ($pattern) |
1301 | =item $value = $term->x_resource ($pattern) |
1289 | |
1302 | |
1290 | Returns the X-Resource for the given pattern, excluding the program or |
1303 | Returns the X-Resource for the given pattern, excluding the program or |
… | |
… | |
1373 | |
1386 | |
1374 | The methods currently supported on C<urxvt::overlay> objects are: |
1387 | The methods currently supported on C<urxvt::overlay> objects are: |
1375 | |
1388 | |
1376 | =over 4 |
1389 | =over 4 |
1377 | |
1390 | |
1378 | =item $overlay->set ($x, $y, $text, $rend) |
1391 | =item $overlay->set ($x, $y, $text[, $rend]) |
1379 | |
1392 | |
1380 | Similar to C<< $term->ROW_t >> and C<< $term->ROW_r >> in that it puts |
1393 | Similar to C<< $term->ROW_t >> and C<< $term->ROW_r >> in that it puts |
1381 | text in rxvt-unicode's special encoding and an array of rendition values |
1394 | text in rxvt-unicode's special encoding and an array of rendition values |
1382 | at a specific position inside the overlay. |
1395 | at a specific position inside the overlay. |
|
|
1396 | |
|
|
1397 | If C<$rend> is missing, then the rendition will not be changed. |
1383 | |
1398 | |
1384 | =item $overlay->hide |
1399 | =item $overlay->hide |
1385 | |
1400 | |
1386 | If visible, hide the overlay, but do not destroy it. |
1401 | If visible, hide the overlay, but do not destroy it. |
1387 | |
1402 | |