… | |
… | |
84 | |
84 | |
85 | Displays a digital clock using the built-in overlay. |
85 | Displays a digital clock using the built-in overlay. |
86 | |
86 | |
87 | =item mark-urls |
87 | =item mark-urls |
88 | |
88 | |
89 | Uses per-line display filtering (C<on_line_update>) to underline urls. |
89 | Uses per-line display filtering (C<on_line_update>) to underline urls and |
|
|
90 | make them clickable. When middle-clicked, the program specified in the |
|
|
91 | resource C<urlLauncher> (default C<x-www-browser>) will be started. |
90 | |
92 | |
91 | =item block-graphics-to-ascii |
93 | =item block-graphics-to-ascii |
92 | |
94 | |
93 | A not very useful example of filtering all text output to the terminal, |
95 | A not very useful example of filtering all text output to the terminal, |
94 | by replacing all line-drawing characters (U+2500 .. U+259F) by a |
96 | by replacing all line-drawing characters (U+2500 .. U+259F) by a |
… | |
… | |
123 | =over 4 |
125 | =over 4 |
124 | |
126 | |
125 | =item $text |
127 | =item $text |
126 | |
128 | |
127 | Rxvt-unicodes special way of encoding text, where one "unicode" character |
129 | Rxvt-unicodes special way of encoding text, where one "unicode" character |
128 | always represents one screen cell. See L<row_t> for a discussion of this format. |
130 | always represents one screen cell. See L<ROW_t> for a discussion of this format. |
129 | |
131 | |
130 | =item $string |
132 | =item $string |
131 | |
133 | |
132 | A perl text string, with an emphasis on I<text>. It can store all unicode |
134 | A perl text string, with an emphasis on I<text>. It can store all unicode |
133 | characters and is to be distinguished with text encoded in a specific |
135 | characters and is to be distinguished with text encoded in a specific |
… | |
… | |
385 | |
387 | |
386 | =item $urxvt::TERM |
388 | =item $urxvt::TERM |
387 | |
389 | |
388 | The current terminal. This variable stores the current C<urxvt::term> |
390 | The current terminal. This variable stores the current C<urxvt::term> |
389 | object, whenever a callback/hook is executing. |
391 | object, whenever a callback/hook is executing. |
390 | |
|
|
391 | =item |
|
|
392 | |
392 | |
393 | =back |
393 | =back |
394 | |
394 | |
395 | =head2 Functions in the C<urxvt> Package |
395 | =head2 Functions in the C<urxvt> Package |
396 | |
396 | |
… | |
… | |
496 | $msg .= "\n" |
496 | $msg .= "\n" |
497 | unless $msg =~ /\n$/; |
497 | unless $msg =~ /\n$/; |
498 | urxvt::warn ($msg); |
498 | urxvt::warn ($msg); |
499 | }; |
499 | }; |
500 | |
500 | |
|
|
501 | # %ENV is the original startup environment |
501 | delete $ENV{IFS}; |
502 | delete $ENV{IFS}; |
502 | delete $ENV{CDPATH}; |
503 | delete $ENV{CDPATH}; |
503 | delete $ENV{BASH_ENV}; |
504 | delete $ENV{BASH_ENV}; |
504 | $ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/opt/sbin"; |
505 | $ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/opt/sbin"; |
505 | } |
506 | } |
… | |
… | |
614 | } |
615 | } |
615 | |
616 | |
616 | $retval |
617 | $retval |
617 | } |
618 | } |
618 | |
619 | |
|
|
620 | sub exec_async(@) { |
|
|
621 | my $pid = fork; |
|
|
622 | |
|
|
623 | return |
|
|
624 | if !defined $pid or $pid; |
|
|
625 | |
|
|
626 | %ENV = %{ $TERM->env }; |
|
|
627 | |
|
|
628 | exec @_; |
|
|
629 | _exit 255; |
|
|
630 | } |
|
|
631 | |
619 | # urxvt::term::extension |
632 | # urxvt::term::extension |
620 | |
633 | |
621 | package urxvt::term::extension; |
634 | package urxvt::term::extension; |
622 | |
635 | |
623 | sub enable { |
636 | sub enable { |
… | |
… | |
782 | } |
795 | } |
783 | |
796 | |
784 | =item $term = new urxvt::term $envhashref, $rxvtname, [arg...] |
797 | =item $term = new urxvt::term $envhashref, $rxvtname, [arg...] |
785 | |
798 | |
786 | Creates a new terminal, very similar as if you had started it with system |
799 | Creates a new terminal, very similar as if you had started it with system |
787 | C<$rxvtname, arg...>. C<$envhashref> must be a reference to a %ENV>-like |
800 | C<$rxvtname, arg...>. C<$envhashref> must be a reference to a C<%ENV>-like |
788 | C<hash which defines the environment of the new terminal. |
801 | hash which defines the environment of the new terminal. |
789 | |
802 | |
790 | Croaks (and probably outputs an error message) if the new instance |
803 | Croaks (and probably outputs an error message) if the new instance |
791 | couldn't be created. Returns C<undef> if the new instance didn't |
804 | couldn't be created. Returns C<undef> if the new instance didn't |
792 | initialise perl, and the terminal object otherwise. The C<init> and |
805 | initialise perl, and the terminal object otherwise. The C<init> and |
793 | C<start> hooks will be called during this call. |
806 | C<start> hooks will be called during this call. |
… | |
… | |
862 | my ($self, $name) = (shift, shift); |
875 | my ($self, $name) = (shift, shift); |
863 | unshift @_, $self, $name, ($name =~ s/\s*\+\s*(\d+)$// ? $1 : 0); |
876 | unshift @_, $self, $name, ($name =~ s/\s*\+\s*(\d+)$// ? $1 : 0); |
864 | &urxvt::term::_resource |
877 | &urxvt::term::_resource |
865 | } |
878 | } |
866 | |
879 | |
|
|
880 | =item $value = $term->x_resource ($pattern) |
|
|
881 | |
|
|
882 | Returns the X-Resource for the given pattern, excluding the program or |
|
|
883 | class name, i.e. C<< $term->x_resource ("boldFont") >> should return the |
|
|
884 | same value as used by this instance of rxvt-unicode. Returns C<undef> if no |
|
|
885 | resource with that pattern exists. |
|
|
886 | |
|
|
887 | This method should only be called during the C<on_start> hook, as there is |
|
|
888 | only one resource database per display, and later invocations might return |
|
|
889 | the wrong resources. |
|
|
890 | |
867 | =item $success = $term->parse_keysym ($keysym_spec, $command_string) |
891 | =item $success = $term->parse_keysym ($keysym_spec, $command_string) |
868 | |
892 | |
869 | Adds a keymap translation exactly as specified via a resource. See the |
893 | Adds a keymap translation exactly as specified via a resource. See the |
870 | C<keysym> resource in the @@RXVT_NAME@@(1) manpage. |
894 | C<keysym> resource in the @@RXVT_NAME@@(1) manpage. |
871 | |
895 | |
… | |
… | |
1441 | my ($self) = @_; |
1465 | my ($self) = @_; |
1442 | |
1466 | |
1443 | delete $self->{term}{_destroy}{$self}; |
1467 | delete $self->{term}{_destroy}{$self}; |
1444 | $self->{term}->ungrab; |
1468 | $self->{term}->ungrab; |
1445 | } |
1469 | } |
|
|
1470 | |
|
|
1471 | =back |
1446 | |
1472 | |
1447 | =head2 The C<urxvt::timer> Class |
1473 | =head2 The C<urxvt::timer> Class |
1448 | |
1474 | |
1449 | This class implements timer watchers/events. Time is represented as a |
1475 | This class implements timer watchers/events. Time is represented as a |
1450 | fractional number of seconds since the epoch. Example: |
1476 | fractional number of seconds since the epoch. Example: |