… | |
… | |
39 | |
39 | |
40 | =over 4 |
40 | =over 4 |
41 | |
41 | |
42 | =item selection |
42 | =item selection |
43 | |
43 | |
44 | Intelligent selection. This etxension tries to be more intelligent when the user |
44 | Intelligent selection. This extension tries to be more intelligent when |
45 | extends selections (double-click). |
45 | the user extends selections (double-click). Right now, it tries to select |
|
|
46 | urls and complete shell-quoted arguments, which is very convenient, too, |
|
|
47 | if your F<ls> supports C<--quoting-style=shell>. |
46 | |
48 | |
47 | It also offers the following bindable event: |
49 | It also offers the following bindable event: |
48 | |
50 | |
49 | =over 4 |
51 | =over 4 |
50 | |
52 | |
… | |
… | |
169 | number of lines that will be in the scrollback buffer. |
171 | number of lines that will be in the scrollback buffer. |
170 | |
172 | |
171 | =item on_tty_activity $term *NYI* |
173 | =item on_tty_activity $term *NYI* |
172 | |
174 | |
173 | Called whenever the program(s) running in the urxvt window send output. |
175 | Called whenever the program(s) running in the urxvt window send output. |
|
|
176 | |
|
|
177 | =item on_osc_seq $term, $string |
|
|
178 | |
|
|
179 | Called whenever the B<ESC ] 777 ; string ST> command sequence is |
|
|
180 | processed. Cursor position and other state information is up-to-date when |
|
|
181 | this happens. For interoperability, the string should start with the |
|
|
182 | extension name and a colon, to distinguish it from commands for other |
|
|
183 | extensions, and this might be enforced in the future. |
174 | |
184 | |
175 | =item on_refresh_begin $term |
185 | =item on_refresh_begin $term |
176 | |
186 | |
177 | Called just before the screen gets redrawn. Can be used for overlay |
187 | Called just before the screen gets redrawn. Can be used for overlay |
178 | or similar effects by modify terminal contents in refresh_begin, and |
188 | or similar effects by modify terminal contents in refresh_begin, and |
… | |
… | |
383 | my $cb = $TERM->{_hook}[$htype] |
393 | my $cb = $TERM->{_hook}[$htype] |
384 | or return; |
394 | or return; |
385 | |
395 | |
386 | verbose 10, "$HOOKNAME[$htype] (" . (join ", ", $TERM, @_) . ")" |
396 | verbose 10, "$HOOKNAME[$htype] (" . (join ", ", $TERM, @_) . ")" |
387 | if $verbosity >= 10; |
397 | if $verbosity >= 10; |
|
|
398 | |
|
|
399 | keys %$cb; |
388 | |
400 | |
389 | while (my ($pkg, $cb) = each %$cb) { |
401 | while (my ($pkg, $cb) = each %$cb) { |
390 | return 1 |
402 | return 1 |
391 | if $cb->( |
403 | if $cb->( |
392 | $TERM->{$pkg} ||= do { |
404 | $TERM->{$pkg} ||= do { |
… | |
… | |
405 | $urxvt::term::proxy::AUTOLOAD =~ /:([^:]+)$/ |
417 | $urxvt::term::proxy::AUTOLOAD =~ /:([^:]+)$/ |
406 | or die "FATAL: \$AUTOLOAD '$urxvt::term::proxy::AUTOLOAD' unparsable"; |
418 | or die "FATAL: \$AUTOLOAD '$urxvt::term::proxy::AUTOLOAD' unparsable"; |
407 | |
419 | |
408 | eval qq{ |
420 | eval qq{ |
409 | sub $urxvt::term::proxy::AUTOLOAD { |
421 | sub $urxvt::term::proxy::AUTOLOAD { |
410 | unshift \@_, shift->{term}; |
422 | my \$proxy = shift; |
411 | goto &urxvt::term::$1; |
423 | \$proxy->{term}->$1 (\@_) |
412 | } |
424 | } |
413 | 1 |
425 | 1 |
414 | } or die "FATAL: unable to compile method forwarder: $@"; |
426 | } or die "FATAL: unable to compile method forwarder: $@"; |
415 | |
427 | |
416 | goto &$urxvt::term::proxy::AUTOLOAD; |
428 | goto &$urxvt::term::proxy::AUTOLOAD; |
… | |
… | |
583 | =item $text = $term->ROW_t ($row_number[, $new_text[, $start_col]]) |
595 | =item $text = $term->ROW_t ($row_number[, $new_text[, $start_col]]) |
584 | |
596 | |
585 | Returns the text of the entire row with number C<$row_number>. Row C<0> |
597 | Returns the text of the entire row with number C<$row_number>. Row C<0> |
586 | is the topmost terminal line, row C<< $term->$ncol-1 >> is the bottommost |
598 | is the topmost terminal line, row C<< $term->$ncol-1 >> is the bottommost |
587 | terminal line. The scrollback buffer starts at line C<-1> and extends to |
599 | terminal line. The scrollback buffer starts at line C<-1> and extends to |
588 | line C<< -$term->nsaved >>. |
600 | line C<< -$term->nsaved >>. Nothing will be returned if a nonexistent line |
|
|
601 | is requested. |
589 | |
602 | |
590 | If C<$new_text> is specified, it will replace characters in the current |
603 | If C<$new_text> is specified, it will replace characters in the current |
591 | line, starting at column C<$start_col> (default C<0>), which is useful |
604 | line, starting at column C<$start_col> (default C<0>), which is useful |
592 | to replace only parts of a line. The font index in the rendition will |
605 | to replace only parts of a line. The font index in the rendition will |
593 | automatically be updated. |
606 | automatically be updated. |
… | |
… | |
615 | |
628 | |
616 | See the section on RENDITION, above. |
629 | See the section on RENDITION, above. |
617 | |
630 | |
618 | =item $length = $term->ROW_l ($row_number[, $new_length]) |
631 | =item $length = $term->ROW_l ($row_number[, $new_length]) |
619 | |
632 | |
620 | Returns the number of screen cells that are in use ("the line length"). If |
633 | Returns the number of screen cells that are in use ("the line |
621 | it is C<-1>, then the line is part of a multiple-row logical "line", which |
634 | length"). Unlike the urxvt core, this returns C<< $term->ncol >> if the |
622 | means all characters are in use and it is continued on the next row. |
635 | line is joined with the following one. |
623 | |
636 | |
|
|
637 | =item $bool = $term->is_longer ($row_number) |
|
|
638 | |
|
|
639 | Returns true if the row is part of a multiple-row logical "line" (i.e. |
|
|
640 | joined with the following row), which means all characters are in use |
|
|
641 | and it is continued on the next row (and possibly a continuation of the |
|
|
642 | previous row(s)). |
|
|
643 | |
|
|
644 | =item $line = $term->line ($row_number) |
|
|
645 | |
|
|
646 | Create and return a new C<urxvt::line> object that stores information |
|
|
647 | about the logical line that row C<$row_number> is part of. It supports the |
|
|
648 | following methods: |
|
|
649 | |
|
|
650 | =over 4 |
|
|
651 | |
|
|
652 | =item $text = $line->t |
|
|
653 | |
|
|
654 | Returns the full text of the line, similar to C<ROW_t> |
|
|
655 | |
|
|
656 | =item $rend = $line->r |
|
|
657 | |
|
|
658 | Returns the full rendition array of the line, similar to C<ROW_r> |
|
|
659 | |
|
|
660 | =item $length = $line->l |
|
|
661 | |
|
|
662 | Returns the length of the line in cells, similar to C<ROW_l>. |
|
|
663 | |
|
|
664 | =item $rownum = $line->beg |
|
|
665 | |
|
|
666 | =item $rownum = $line->end |
|
|
667 | |
|
|
668 | Return the row number of the first/last row of the line, respectively. |
|
|
669 | |
|
|
670 | =item $offset = $line->offset_of ($row, $col) |
|
|
671 | |
|
|
672 | Returns the character offset of the given row|col pair within the logical |
|
|
673 | line. |
|
|
674 | |
|
|
675 | =item ($row, $col) = $line->coord_of ($offset) |
|
|
676 | |
|
|
677 | Translates a string offset into terminal coordinates again. |
|
|
678 | |
|
|
679 | =back |
|
|
680 | |
|
|
681 | =cut |
|
|
682 | |
|
|
683 | sub urxvt::term::line { |
|
|
684 | my ($self, $row) = @_; |
|
|
685 | |
|
|
686 | my $maxrow = $self->nrow - 1; |
|
|
687 | |
|
|
688 | my ($beg, $end) = ($row, $row); |
|
|
689 | |
|
|
690 | --$beg while $self->ROW_is_longer ($beg - 1); |
|
|
691 | ++$end while $self->ROW_is_longer ($end) && $end < $maxrow; |
|
|
692 | |
|
|
693 | bless { |
|
|
694 | term => $self, |
|
|
695 | beg => $beg, |
|
|
696 | end => $end, |
|
|
697 | len => ($end - $beg) * $self->ncol + $self->ROW_l ($end), |
|
|
698 | }, urxvt::line:: |
|
|
699 | } |
|
|
700 | |
|
|
701 | sub urxvt::line::t { |
|
|
702 | my ($self) = @_; |
|
|
703 | |
|
|
704 | substr +(join "", map $self->{term}->ROW_t ($_), $self->{beg} .. $self->{end}), |
|
|
705 | 0, $self->{len} |
|
|
706 | } |
|
|
707 | |
|
|
708 | sub urxvt::line::r { |
|
|
709 | my ($self) = @_; |
|
|
710 | |
|
|
711 | my $rend = [ |
|
|
712 | map @{ $self->{term}->ROW_r ($_) }, $self->{beg} .. $self->{end} |
|
|
713 | ]; |
|
|
714 | $#$rend = $self->{len} - 1; |
|
|
715 | $rend |
|
|
716 | } |
|
|
717 | |
|
|
718 | sub urxvt::line::beg { $_[0]{beg} } |
|
|
719 | sub urxvt::line::end { $_[0]{end} } |
|
|
720 | sub urxvt::line::l { $_[0]{len} } |
|
|
721 | |
|
|
722 | sub urxvt::line::offset_of { |
|
|
723 | my ($self, $row, $col) = @_; |
|
|
724 | |
|
|
725 | ($row - $self->{beg}) * $self->{term}->ncol + $col |
|
|
726 | } |
|
|
727 | |
|
|
728 | sub urxvt::line::coord_of { |
|
|
729 | my ($self, $offset) = @_; |
|
|
730 | |
|
|
731 | use integer; |
|
|
732 | |
|
|
733 | ( |
|
|
734 | $offset / $self->{term}->ncol + $self->{beg}, |
|
|
735 | $offset % $self->{term}->ncol |
|
|
736 | ) |
|
|
737 | } |
|
|
738 | |
|
|
739 | =item ($row, $col) = $line->coord_of ($offset) |
624 | =item $text = $term->special_encode $string |
740 | =item $text = $term->special_encode $string |
625 | |
741 | |
626 | Converts a perl string into the special encoding used by rxvt-unicode, |
742 | Converts a perl string into the special encoding used by rxvt-unicode, |
627 | where one character corresponds to one screen cell. See |
743 | where one character corresponds to one screen cell. See |
628 | C<< $term->ROW_t >> for details. |
744 | C<< $term->ROW_t >> for details. |
… | |
… | |
742 | This variable controls the verbosity level of the perl extension. Higher |
858 | This variable controls the verbosity level of the perl extension. Higher |
743 | numbers indicate more verbose output. |
859 | numbers indicate more verbose output. |
744 | |
860 | |
745 | =over 4 |
861 | =over 4 |
746 | |
862 | |
747 | =item 0 - only fatal messages |
863 | =item =0 - only fatal messages |
748 | |
864 | |
749 | =item 3 - script loading and management |
865 | =item =3 - script loading and management |
750 | |
866 | |
751 | =item 10 - all events received |
867 | =item =10 - all events received |
752 | |
868 | |
753 | =back |
869 | =back |
754 | |
870 | |
755 | =head1 AUTHOR |
871 | =head1 AUTHOR |
756 | |
872 | |