1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
3 | <head> |
3 | <head> |
4 | <title>urxvtperl - rxvt-unicode's embedded perl interpreter</title> |
4 | <title>rxvtperl - rxvt-unicode's embedded perl interpreter</title> |
5 | <link rev="made" href="mailto:perl-binary@plan9.de" /> |
5 | <link rev="made" href="mailto:perl-binary@plan9.de" /> |
6 | </head> |
6 | </head> |
7 | |
7 | |
8 | <body style="background-color: white"> |
8 | <body style="background-color: white"> |
9 | |
9 | |
… | |
… | |
45 | <hr /> |
45 | <hr /> |
46 | <p> |
46 | <p> |
47 | </p> |
47 | </p> |
48 | <hr /> |
48 | <hr /> |
49 | <h1><a name="name">NAME</a></h1> |
49 | <h1><a name="name">NAME</a></h1> |
50 | <p>urxvtperl - rxvt-unicode's embedded perl interpreter</p> |
50 | <p>rxvtperl - rxvt-unicode's embedded perl interpreter</p> |
51 | <p> |
51 | <p> |
52 | </p> |
52 | </p> |
53 | <hr /> |
53 | <hr /> |
54 | <h1><a name="synopsis">SYNOPSIS</a></h1> |
54 | <h1><a name="synopsis">SYNOPSIS</a></h1> |
55 | <pre> |
55 | <pre> |
… | |
… | |
58 | sub on_sel_grab { |
58 | sub on_sel_grab { |
59 | warn "you selected ", $_[0]->selection; |
59 | warn "you selected ", $_[0]->selection; |
60 | () |
60 | () |
61 | }</pre> |
61 | }</pre> |
62 | <pre> |
62 | <pre> |
63 | # start a urxvt using it:</pre> |
63 | # start a rxvt using it:</pre> |
64 | <pre> |
64 | <pre> |
65 | urxvt --perl-lib $HOME -pe grab_test</pre> |
65 | rxvt --perl-lib $HOME -pe grab_test</pre> |
66 | <p> |
66 | <p> |
67 | </p> |
67 | </p> |
68 | <hr /> |
68 | <hr /> |
69 | <h1><a name="description">DESCRIPTION</a></h1> |
69 | <h1><a name="description">DESCRIPTION</a></h1> |
70 | <p>Everytime a terminal object gets created, extension scripts specified via |
70 | <p>Everytime a terminal object gets created, extension scripts specified via |
71 | the <code>perl</code> resource are loaded and associated with it.</p> |
71 | the <code>perl</code> resource are loaded and associated with it.</p> |
72 | <p>Scripts are compiled in a 'use strict' and 'use utf8' environment, and |
72 | <p>Scripts are compiled in a 'use strict' and 'use utf8' environment, and |
73 | thus must be encoded as UTF-8.</p> |
73 | thus must be encoded as UTF-8.</p> |
74 | <p>Each script will only ever be loaded once, even in urxvtd, where |
74 | <p>Each script will only ever be loaded once, even in rxvtd, where |
75 | scripts will be shared (but not enabled) for all terminals.</p> |
75 | scripts will be shared (but not enabled) for all terminals.</p> |
76 | <p> |
76 | <p> |
77 | </p> |
77 | </p> |
78 | <hr /> |
78 | <hr /> |
79 | <h1><a name="prepackaged_extensions">PREPACKAGED EXTENSIONS</a></h1> |
79 | <h1><a name="prepackaged_extensions">PREPACKAGED EXTENSIONS</a></h1> |
80 | <p>This section describes the extensions delivered with this release. You can |
80 | <p>This section describes the extensions delivered with this release. You can |
81 | find them in <em>/usr/local/lib/urxvt/perl/</em>.</p> |
81 | find them in <em>/opt/rxvt/lib/urxvt/perl/</em>.</p> |
82 | <p>You can activate them like this:</p> |
82 | <p>You can activate them like this:</p> |
83 | <pre> |
83 | <pre> |
84 | urxvt -pe <extensionname></pre> |
84 | rxvt -pe <extensionname></pre> |
85 | <dl> |
85 | <dl> |
86 | <dt><strong><a name="item_selection">selection (enabled by default)</a></strong><br /> |
86 | <dt><strong><a name="item_selection">selection (enabled by default)</a></strong><br /> |
87 | </dt> |
87 | </dt> |
88 | <dd> |
88 | <dd> |
89 | (More) intelligent selection. This extension tries to be more intelligent |
89 | (More) intelligent selection. This extension tries to be more intelligent |
… | |
… | |
120 | <dd> |
120 | <dd> |
121 | <p>You can look at the source of the selection extension to see more |
121 | <p>You can look at the source of the selection extension to see more |
122 | interesting uses, such as parsing a line from beginning to end.</p> |
122 | interesting uses, such as parsing a line from beginning to end.</p> |
123 | </dd> |
123 | </dd> |
124 | <dd> |
124 | <dd> |
125 | <p>This extension also offers the following bindable keyboard command:</p> |
125 | <p>This extension also offers following bindable keyboard commands:</p> |
126 | </dd> |
126 | </dd> |
127 | <dl> |
127 | <dl> |
128 | <dt><strong><a name="item_rot13">rot13</a></strong><br /> |
128 | <dt><strong><a name="item_rot13">rot13</a></strong><br /> |
129 | </dt> |
129 | </dt> |
130 | <dd> |
130 | <dd> |
131 | Rot-13 the selection when activated. Used via keyboard trigger: |
131 | Rot-13 the selection when activated. Used via keyboard trigger: |
132 | </dd> |
132 | </dd> |
133 | <dd> |
133 | <dd> |
134 | <pre> |
134 | <pre> |
135 | URxvt.keysym.C-M-r: perl:selection:rot13</pre> |
135 | URxvt.keysym.C-M-r: perl:selection:rot13</pre> |
|
|
136 | </dd> |
|
|
137 | <p></p> |
|
|
138 | <dt><strong><a name="item_remote_2dpastebin">remote-pastebin</a></strong><br /> |
|
|
139 | </dt> |
|
|
140 | <dd> |
|
|
141 | Upload the selection as textfile to a remote site. |
|
|
142 | </dd> |
|
|
143 | <dd> |
|
|
144 | <pre> |
|
|
145 | URxvt.keysym.C-M-e: perl:selection:remote-pastebin</pre> |
|
|
146 | </dd> |
|
|
147 | <dd> |
|
|
148 | <p>To set the command to upload the file set this resource:</p> |
|
|
149 | </dd> |
|
|
150 | <dd> |
|
|
151 | <pre> |
|
|
152 | URxvt.selection-pastebin-cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/.</pre> |
|
|
153 | </dd> |
|
|
154 | <dd> |
|
|
155 | <p>The % is the placeholder for the textfile. The name of the textfile is the hex encoded |
|
|
156 | md5 sum of the selection. |
|
|
157 | After an successful upload the selection will be replaced by the following url |
|
|
158 | (the % is the placeholder for the filename):</p> |
|
|
159 | </dd> |
|
|
160 | <dd> |
|
|
161 | <pre> |
|
|
162 | URxvt.selection-pastebin-url: <a href="http://www.ta-sa.org/files/txt/%">http://www.ta-sa.org/files/txt/%</a></pre> |
136 | </dd> |
163 | </dd> |
137 | <p></p></dl> |
164 | <p></p></dl> |
138 | <dt><strong><a name="item_popup">option-popup (enabled by default)</a></strong><br /> |
165 | <dt><strong><a name="item_popup">option-popup (enabled by default)</a></strong><br /> |
139 | </dt> |
166 | </dt> |
140 | <dd> |
167 | <dd> |
… | |
… | |
489 | <dt><strong><a name="item_on_keyboard_command__24term_2c__24string">on_keyboard_command $term, $string</a></strong><br /> |
516 | <dt><strong><a name="item_on_keyboard_command__24term_2c__24string">on_keyboard_command $term, $string</a></strong><br /> |
490 | </dt> |
517 | </dt> |
491 | <dd> |
518 | <dd> |
492 | Called whenever the user presses a key combination that has a |
519 | Called whenever the user presses a key combination that has a |
493 | <code>perl:string</code> action bound to it (see description of the <strong>keysym</strong> |
520 | <code>perl:string</code> action bound to it (see description of the <strong>keysym</strong> |
494 | resource in the <code>urxvt(1)</code> manpage). |
521 | resource in the <code>rxvt(1)</code> manpage). |
495 | </dd> |
522 | </dd> |
496 | <p></p> |
523 | <p></p> |
497 | <dt><strong><a name="item_on_x_event__24term_2c__24event">on_x_event $term, $event</a></strong><br /> |
524 | <dt><strong><a name="item_on_x_event__24term_2c__24event">on_x_event $term, $event</a></strong><br /> |
498 | </dt> |
525 | </dt> |
499 | <dd> |
526 | <dd> |
… | |
… | |
600 | <p>Using this function has the advantage that its output ends up in the |
627 | <p>Using this function has the advantage that its output ends up in the |
601 | correct place, e.g. on stderr of the connecting urxvtc client.</p> |
628 | correct place, e.g. on stderr of the connecting urxvtc client.</p> |
602 | </dd> |
629 | </dd> |
603 | <dd> |
630 | <dd> |
604 | <p>Messages have a size limit of 1023 bytes currently.</p> |
631 | <p>Messages have a size limit of 1023 bytes currently.</p> |
605 | </dd> |
|
|
606 | <p></p> |
|
|
607 | <dt><strong><a name="item__24is_safe__3d_urxvt_3a_3asafe">$is_safe = urxvt::safe</a></strong><br /> |
|
|
608 | </dt> |
|
|
609 | <dd> |
|
|
610 | Returns true when it is safe to do potentially unsafe things, such as |
|
|
611 | evaluating perl code specified by the user. This is true when urxvt was |
|
|
612 | started setuid or setgid. |
|
|
613 | </dd> |
632 | </dd> |
614 | <p></p> |
633 | <p></p> |
615 | <dt><strong><a name="item__24time__3d_urxvt_3a_3anow">$time = urxvt::NOW</a></strong><br /> |
634 | <dt><strong><a name="item__24time__3d_urxvt_3a_3anow">$time = urxvt::NOW</a></strong><br /> |
616 | </dt> |
635 | </dt> |
617 | <dd> |
636 | <dd> |
… | |
… | |
735 | <p></p> |
754 | <p></p> |
736 | <dt><strong><a name="item_destroy">$term->destroy</a></strong><br /> |
755 | <dt><strong><a name="item_destroy">$term->destroy</a></strong><br /> |
737 | </dt> |
756 | </dt> |
738 | <dd> |
757 | <dd> |
739 | Destroy the terminal object (close the window, free resources |
758 | Destroy the terminal object (close the window, free resources |
740 | etc.). Please note that urxvt will not exit as long as any event |
759 | etc.). Please note that rxvt will not exit as long as any event |
741 | watchers (timers, io watchers) are still active. |
760 | watchers (timers, io watchers) are still active. |
742 | </dd> |
761 | </dd> |
743 | <p></p> |
762 | <p></p> |
744 | <dt><strong><a name="item_option">$isset = $term->option ($optval[, $set])</a></strong><br /> |
763 | <dt><strong><a name="item_option">$isset = $term->option ($optval[, $set])</a></strong><br /> |
745 | </dt> |
764 | </dt> |
… | |
… | |
820 | <p></p> |
839 | <p></p> |
821 | <dt><strong><a name="item_parse_keysym">$success = $term->parse_keysym ($keysym_spec, $command_string)</a></strong><br /> |
840 | <dt><strong><a name="item_parse_keysym">$success = $term->parse_keysym ($keysym_spec, $command_string)</a></strong><br /> |
822 | </dt> |
841 | </dt> |
823 | <dd> |
842 | <dd> |
824 | Adds a keymap translation exactly as specified via a resource. See the |
843 | Adds a keymap translation exactly as specified via a resource. See the |
825 | <code>keysym</code> resource in the <code>urxvt(1)</code> manpage. |
844 | <code>keysym</code> resource in the <code>rxvt(1)</code> manpage. |
826 | </dd> |
845 | </dd> |
827 | <p></p> |
846 | <p></p> |
828 | <dt><strong><a name="item_rstyle">$rend = $term->rstyle ([$new_rstyle])</a></strong><br /> |
847 | <dt><strong><a name="item_rstyle">$rend = $term->rstyle ([$new_rstyle])</a></strong><br /> |
829 | </dt> |
848 | </dt> |
830 | <dd> |
849 | <dd> |
… | |
… | |
1054 | </dt> |
1073 | </dt> |
1055 | <dt><strong><a name="item_savelines">$max_scrollback = $term->saveLines</a></strong><br /> |
1074 | <dt><strong><a name="item_savelines">$max_scrollback = $term->saveLines</a></strong><br /> |
1056 | </dt> |
1075 | </dt> |
1057 | <dt><strong><a name="item_total_rows">$nrow_plus_saveLines = $term->total_rows</a></strong><br /> |
1076 | <dt><strong><a name="item_total_rows">$nrow_plus_saveLines = $term->total_rows</a></strong><br /> |
1058 | </dt> |
1077 | </dt> |
1059 | <dt><strong><a name="item_nsaved">$lines_in_scrollback = $term->nsaved</a></strong><br /> |
1078 | <dt><strong><a name="item_top_row">$topmost_scrollback_row = $term->top_row</a></strong><br /> |
1060 | </dt> |
1079 | </dt> |
1061 | <dd> |
1080 | <dd> |
1062 | Return various integers describing terminal characteristics. |
1081 | Return various integers describing terminal characteristics. |
1063 | </dd> |
1082 | </dd> |
1064 | <p></p> |
1083 | <p></p> |
… | |
… | |
1093 | </dd> |
1112 | </dd> |
1094 | <p></p> |
1113 | <p></p> |
1095 | <dt><strong><a name="item_view_start">$view_start = $term->view_start ([$newvalue])</a></strong><br /> |
1114 | <dt><strong><a name="item_view_start">$view_start = $term->view_start ([$newvalue])</a></strong><br /> |
1096 | </dt> |
1115 | </dt> |
1097 | <dd> |
1116 | <dd> |
1098 | Returns the negative row number of the topmost line. Minimum value is |
1117 | Returns the row number of the topmost displayed line. Maximum value is |
1099 | <code>0</code>, which displays the normal terminal contents. Larger values scroll |
1118 | <code>0</code>, which displays the normal terminal contents. Lower values scroll |
1100 | this many lines into the scrollback buffer. |
1119 | this many lines into the scrollback buffer. |
1101 | </dd> |
1120 | </dd> |
1102 | <p></p> |
1121 | <p></p> |
1103 | <dt><strong><a name="item_want_refresh">$term->want_refresh</a></strong><br /> |
1122 | <dt><strong><a name="item_want_refresh">$term->want_refresh</a></strong><br /> |
1104 | </dt> |
1123 | </dt> |
… | |
… | |
1115 | </dt> |
1134 | </dt> |
1116 | <dd> |
1135 | <dd> |
1117 | Returns the text of the entire row with number <code>$row_number</code>. Row <code>0</code> |
1136 | Returns the text of the entire row with number <code>$row_number</code>. Row <code>0</code> |
1118 | is the topmost terminal line, row <code>$term->$ncol-1</code> is the bottommost |
1137 | is the topmost terminal line, row <code>$term->$ncol-1</code> is the bottommost |
1119 | terminal line. The scrollback buffer starts at line <code>-1</code> and extends to |
1138 | terminal line. The scrollback buffer starts at line <code>-1</code> and extends to |
1120 | line <a href="#item_nsaved"><code>-$term->nsaved</code></a>. Nothing will be returned if a nonexistent line |
1139 | line <code>-$term->nsaved</code>. Nothing will be returned if a nonexistent line |
1121 | is requested. |
1140 | is requested. |
1122 | </dd> |
1141 | </dd> |
1123 | <dd> |
1142 | <dd> |
1124 | <p>If <code>$new_text</code> is specified, it will replace characters in the current |
1143 | <p>If <code>$new_text</code> is specified, it will replace characters in the current |
1125 | line, starting at column <code>$start_col</code> (default <code>0</code>), which is useful |
1144 | line, starting at column <code>$start_col</code> (default <code>0</code>), which is useful |