ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/doc/rxvtperl.3.html
(Generate patch)

Comparing rxvt-unicode/doc/rxvtperl.3.html (file contents):
Revision 1.29 by root, Fri Jan 13 12:40:46 2006 UTC vs.
Revision 1.32 by root, Wed Jan 18 09:40:53 2006 UTC

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 &quot;you selected &quot;, $_[0]-&gt;selection; 59 warn &quot;you selected &quot;, $_[0]-&gt;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
71the <code>perl</code> resource are loaded and associated with it.</p> 71the <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
73thus must be encoded as UTF-8.</p> 73thus 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
75scripts will be shared (but not enabled) for all terminals.</p> 75scripts 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
81find them in <em>/usr/local/lib/urxvt/perl/</em>.</p> 81find 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 &lt;extensionname&gt;</pre> 84 rxvt -pe &lt;extensionname&gt;</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
122interesting uses, such as parsing a line from beginning to end.</p> 122interesting 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>
246</dt> 246</dt>
247<dd> 247<dd>
248Displays a very simple digital clock in the upper right corner of the 248Displays a very simple digital clock in the upper right corner of the
249window. Illustrates overwriting the refresh callbacks to create your own 249window. Illustrates overwriting the refresh callbacks to create your own
250overlays or changes. 250overlays or changes.
251</dd>
252<p></p>
253<dt><strong><a name="item_selection_2dpastebin">selection-pastebin</a></strong><br />
254</dt>
255<dd>
256This is a little rarely useful extension that Uploads the selection as
257textfile to a remote site (or does other things). (The implementation is
258not currently secure for use in a multiuser environment as it writes to
259<em>/tmp</em> directly.).
260</dd>
261<dd>
262<p>It listens to the <code>selection-pastebin:remote-pastebin</code> keyboard command,
263i.e.</p>
264</dd>
265<dd>
266<pre>
267 URxvt.keysym.C-M-e: perl:selection-pastebin:remote-pastebin</pre>
268</dd>
269<dd>
270<p>Pressing this combination runs a command with <code>%</code> replaced by the name of
271the textfile. This command can be set via a resource:</p>
272</dd>
273<dd>
274<pre>
275 URxvt.selection-pastebin.cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/.</pre>
276</dd>
277<dd>
278<p>And the default is likely not useful to anybody but the few people around
279here :)</p>
280</dd>
281<dd>
282<p>The name of the textfile is the hex encoded md5 sum of the selection, so
283the same content should lead to the same filename.</p>
284</dd>
285<dd>
286<p>After a successful upload the selection will be replaced by the text given
287in the <code>selection-pastebin-url</code> resource (again, the % is the placeholder
288for the filename):</p>
289</dd>
290<dd>
291<pre>
292 URxvt.selection-pastebin.url: <a href="http://www.ta-sa.org/files/txt/%">http://www.ta-sa.org/files/txt/%</a></pre>
251</dd> 293</dd>
252<p></p></dl> 294<p></p></dl>
253<p> 295<p>
254</p> 296</p>
255<hr /> 297<hr />
489<dt><strong><a name="item_on_keyboard_command__24term_2c__24string">on_keyboard_command $term, $string</a></strong><br /> 531<dt><strong><a name="item_on_keyboard_command__24term_2c__24string">on_keyboard_command $term, $string</a></strong><br />
490</dt> 532</dt>
491<dd> 533<dd>
492Called whenever the user presses a key combination that has a 534Called 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> 535<code>perl:string</code> action bound to it (see description of the <strong>keysym</strong>
494resource in the <code>urxvt(1)</code> manpage). 536resource in the <code>rxvt(1)</code> manpage).
495</dd> 537</dd>
496<p></p> 538<p></p>
497<dt><strong><a name="item_on_x_event__24term_2c__24event">on_x_event $term, $event</a></strong><br /> 539<dt><strong><a name="item_on_x_event__24term_2c__24event">on_x_event $term, $event</a></strong><br />
498</dt> 540</dt>
499<dd> 541<dd>
600<p>Using this function has the advantage that its output ends up in the 642<p>Using this function has the advantage that its output ends up in the
601correct place, e.g. on stderr of the connecting urxvtc client.</p> 643correct place, e.g. on stderr of the connecting urxvtc client.</p>
602</dd> 644</dd>
603<dd> 645<dd>
604<p>Messages have a size limit of 1023 bytes currently.</p> 646<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>
610Returns true when it is safe to do potentially unsafe things, such as
611evaluating perl code specified by the user. This is true when urxvt was
612started setuid or setgid.
613</dd> 647</dd>
614<p></p> 648<p></p>
615<dt><strong><a name="item__24time__3d_urxvt_3a_3anow">$time = urxvt::NOW</a></strong><br /> 649<dt><strong><a name="item__24time__3d_urxvt_3a_3anow">$time = urxvt::NOW</a></strong><br />
616</dt> 650</dt>
617<dd> 651<dd>
735<p></p> 769<p></p>
736<dt><strong><a name="item_destroy">$term-&gt;destroy</a></strong><br /> 770<dt><strong><a name="item_destroy">$term-&gt;destroy</a></strong><br />
737</dt> 771</dt>
738<dd> 772<dd>
739Destroy the terminal object (close the window, free resources 773Destroy the terminal object (close the window, free resources
740etc.). Please note that urxvt will not exit as long as any event 774etc.). Please note that rxvt will not exit as long as any event
741watchers (timers, io watchers) are still active. 775watchers (timers, io watchers) are still active.
742</dd> 776</dd>
743<p></p> 777<p></p>
744<dt><strong><a name="item_option">$isset = $term-&gt;option ($optval[, $set])</a></strong><br /> 778<dt><strong><a name="item_option">$isset = $term-&gt;option ($optval[, $set])</a></strong><br />
745</dt> 779</dt>
820<p></p> 854<p></p>
821<dt><strong><a name="item_parse_keysym">$success = $term-&gt;parse_keysym ($keysym_spec, $command_string)</a></strong><br /> 855<dt><strong><a name="item_parse_keysym">$success = $term-&gt;parse_keysym ($keysym_spec, $command_string)</a></strong><br />
822</dt> 856</dt>
823<dd> 857<dd>
824Adds a keymap translation exactly as specified via a resource. See the 858Adds a keymap translation exactly as specified via a resource. See the
825<code>keysym</code> resource in the <code>urxvt(1)</code> manpage. 859<code>keysym</code> resource in the <code>rxvt(1)</code> manpage.
826</dd> 860</dd>
827<p></p> 861<p></p>
828<dt><strong><a name="item_rstyle">$rend = $term-&gt;rstyle ([$new_rstyle])</a></strong><br /> 862<dt><strong><a name="item_rstyle">$rend = $term-&gt;rstyle ([$new_rstyle])</a></strong><br />
829</dt> 863</dt>
830<dd> 864<dd>
1054</dt> 1088</dt>
1055<dt><strong><a name="item_savelines">$max_scrollback = $term-&gt;saveLines</a></strong><br /> 1089<dt><strong><a name="item_savelines">$max_scrollback = $term-&gt;saveLines</a></strong><br />
1056</dt> 1090</dt>
1057<dt><strong><a name="item_total_rows">$nrow_plus_saveLines = $term-&gt;total_rows</a></strong><br /> 1091<dt><strong><a name="item_total_rows">$nrow_plus_saveLines = $term-&gt;total_rows</a></strong><br />
1058</dt> 1092</dt>
1059<dt><strong><a name="item_nsaved">$lines_in_scrollback = $term-&gt;nsaved</a></strong><br /> 1093<dt><strong><a name="item_top_row">$topmost_scrollback_row = $term-&gt;top_row</a></strong><br />
1060</dt> 1094</dt>
1061<dd> 1095<dd>
1062Return various integers describing terminal characteristics. 1096Return various integers describing terminal characteristics.
1063</dd> 1097</dd>
1064<p></p> 1098<p></p>
1093</dd> 1127</dd>
1094<p></p> 1128<p></p>
1095<dt><strong><a name="item_view_start">$view_start = $term-&gt;view_start ([$newvalue])</a></strong><br /> 1129<dt><strong><a name="item_view_start">$view_start = $term-&gt;view_start ([$newvalue])</a></strong><br />
1096</dt> 1130</dt>
1097<dd> 1131<dd>
1098Returns the negative row number of the topmost line. Minimum value is 1132Returns the row number of the topmost displayed line. Maximum value is
1099<code>0</code>, which displays the normal terminal contents. Larger values scroll 1133<code>0</code>, which displays the normal terminal contents. Lower values scroll
1100this many lines into the scrollback buffer. 1134this many lines into the scrollback buffer.
1101</dd> 1135</dd>
1102<p></p> 1136<p></p>
1103<dt><strong><a name="item_want_refresh">$term-&gt;want_refresh</a></strong><br /> 1137<dt><strong><a name="item_want_refresh">$term-&gt;want_refresh</a></strong><br />
1104</dt> 1138</dt>
1115</dt> 1149</dt>
1116<dd> 1150<dd>
1117Returns the text of the entire row with number <code>$row_number</code>. Row <code>0</code> 1151Returns the text of the entire row with number <code>$row_number</code>. Row <code>0</code>
1118is the topmost terminal line, row <code>$term-&gt;$ncol-1</code> is the bottommost 1152is the topmost terminal line, row <code>$term-&gt;$ncol-1</code> is the bottommost
1119terminal line. The scrollback buffer starts at line <code>-1</code> and extends to 1153terminal line. The scrollback buffer starts at line <code>-1</code> and extends to
1120line <a href="#item_nsaved"><code>-$term-&gt;nsaved</code></a>. Nothing will be returned if a nonexistent line 1154line <code>-$term-&gt;nsaved</code>. Nothing will be returned if a nonexistent line
1121is requested. 1155is requested.
1122</dd> 1156</dd>
1123<dd> 1157<dd>
1124<p>If <code>$new_text</code> is specified, it will replace characters in the current 1158<p>If <code>$new_text</code> is specified, it will replace characters in the current
1125line, starting at column <code>$start_col</code> (default <code>0</code>), which is useful 1159line, starting at column <code>$start_col</code> (default <code>0</code>), which is useful

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines