… | |
… | |
15 | <li><a href="#name">NAME</a></li> |
15 | <li><a href="#name">NAME</a></li> |
16 | <li><a href="#synopsis">SYNOPSIS</a></li> |
16 | <li><a href="#synopsis">SYNOPSIS</a></li> |
17 | <li><a href="#description">DESCRIPTION</a></li> |
17 | <li><a href="#description">DESCRIPTION</a></li> |
18 | <ul> |
18 | <ul> |
19 | |
19 | |
|
|
20 | <li><a href="#prepackaged_extensions">Prepackaged Extensions</a></li> |
|
|
21 | <li><a href="#general_api_considerations">General API Considerations</a></li> |
20 | <li><a href="#hooks">Hooks</a></li> |
22 | <li><a href="#hooks">Hooks</a></li> |
21 | <li><a href="#functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></li> |
23 | <li><a href="#functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></li> |
|
|
24 | <li><a href="#rendition">RENDITION</a></li> |
22 | <li><a href="#the_urxvt__term_class">The <code>urxvt::term</code> Class</a></li> |
25 | <li><a href="#the_urxvt__term_class">The <code>urxvt::term</code> Class</a></li> |
23 | <li><a href="#the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></li> |
26 | <li><a href="#the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></li> |
24 | <li><a href="#the_urxvt__iow_class">The <code>urxvt::iow</code> Class</a></li> |
27 | <li><a href="#the_urxvt__iow_class">The <code>urxvt::iow</code> Class</a></li> |
25 | </ul> |
28 | </ul> |
26 | |
29 | |
|
|
30 | <li><a href="#environment">ENVIRONMENT</a></li> |
|
|
31 | <ul> |
|
|
32 | |
|
|
33 | <li><a href="#urxvt_perl_verbosity">URXVT_PERL_VERBOSITY</a></li> |
|
|
34 | </ul> |
|
|
35 | |
27 | <li><a href="#author">AUTHOR</a></li> |
36 | <li><a href="#author">AUTHOR</a></li> |
28 | </ul> |
37 | </ul> |
29 | <!-- INDEX END --> |
38 | <!-- INDEX END --> |
30 | |
39 | |
31 | <hr /> |
40 | <hr /> |
32 | <p> |
41 | <p> |
33 | </p> |
42 | </p> |
|
|
43 | <hr /> |
34 | <h1><a name="name">NAME</a></h1> |
44 | <h1><a name="name">NAME</a></h1> |
35 | <p>rxvtperl - rxvt-unicode's embedded perl interpreter</p> |
45 | <p>rxvtperl - rxvt-unicode's embedded perl interpreter</p> |
36 | <p> |
46 | <p> |
37 | </p> |
47 | </p> |
38 | <hr /> |
48 | <hr /> |
39 | <h1><a name="synopsis">SYNOPSIS</a></h1> |
49 | <h1><a name="synopsis">SYNOPSIS</a></h1> |
40 | <p>* Put your scripts into <em>/opt/rxvt/lib/urxvt/perl-ext/</em>, they will be loaded automatically.</p> |
50 | <pre> |
41 | <p>* Each script will only be loaded once, even in urxvtd, and will be valid |
51 | # create a file grab_test in $HOME:</pre> |
42 | globally.</p> |
|
|
43 | <p>* Scripts are evaluated in a 'use strict' and 'use utf8' environment, and |
|
|
44 | thus must be encoded as UTF-8.</p> |
|
|
45 | <pre> |
52 | <pre> |
46 | sub on_sel_grab { |
53 | sub on_sel_grab { |
47 | warn "you selected ", $_[0]->selection; |
54 | warn "you selected ", $_[0]->selection; |
48 | () |
55 | () |
49 | }</pre> |
56 | }</pre> |
50 | <pre> |
57 | <pre> |
51 | 1</pre> |
58 | # start a rxvt using it:</pre> |
|
|
59 | <pre> |
|
|
60 | rxvt --perl-lib $HOME -pe grab_test</pre> |
52 | <p> |
61 | <p> |
53 | </p> |
62 | </p> |
54 | <hr /> |
63 | <hr /> |
55 | <h1><a name="description">DESCRIPTION</a></h1> |
64 | <h1><a name="description">DESCRIPTION</a></h1> |
|
|
65 | <p>Everytime a terminal object gets created, scripts specified via the |
|
|
66 | <code>perl</code> resource are loaded and associated with it.</p> |
|
|
67 | <p>Scripts are compiled in a 'use strict' and 'use utf8' environment, and |
|
|
68 | thus must be encoded as UTF-8.</p> |
|
|
69 | <p>Each script will only ever be loaded once, even in rxvtd, where |
|
|
70 | scripts will be shared (but not enabled) for all terminals.</p> |
|
|
71 | <p> |
|
|
72 | </p> |
|
|
73 | <h2><a name="prepackaged_extensions">Prepackaged Extensions</a></h2> |
|
|
74 | <p>This section describes the extensiosn delivered with this version. You can |
|
|
75 | find them in <em>/opt/rxvt/lib/urxvt/perl/</em>.</p> |
|
|
76 | <p>You can activate them like this:</p> |
|
|
77 | <pre> |
|
|
78 | rxvt -pe <extensionname></pre> |
|
|
79 | <dl> |
|
|
80 | <dt><strong><a name="item_selection">selection</a></strong><br /> |
|
|
81 | </dt> |
|
|
82 | <dd> |
|
|
83 | Miscellaneous selection modifications. |
|
|
84 | </dd> |
|
|
85 | <dl> |
|
|
86 | <dt><strong><a name="item_rot13">rot13</a></strong><br /> |
|
|
87 | </dt> |
|
|
88 | <dd> |
|
|
89 | Rot-13 the selection when activated. Used via keyboard trigger: |
|
|
90 | </dd> |
|
|
91 | <dd> |
|
|
92 | <pre> |
|
|
93 | URxvt.keysym.C-M-r: perl:selection:rot13</pre> |
|
|
94 | </dd> |
|
|
95 | <p></p></dl> |
|
|
96 | <dt><strong><a name="item_digital_2dclock">digital-clock</a></strong><br /> |
|
|
97 | </dt> |
|
|
98 | <dd> |
|
|
99 | Displays a digital clock using the built-in overlay. |
|
|
100 | </dd> |
|
|
101 | <p></p> |
|
|
102 | <dt><strong><a name="item_example_2drefresh_2dhooks">example-refresh-hooks</a></strong><br /> |
|
|
103 | </dt> |
|
|
104 | <dd> |
|
|
105 | Displays a very simple digital clock in the upper right corner of the |
|
|
106 | window. Illustrates overwriting the refresh callbacks to create your own |
|
|
107 | overlays or changes. |
|
|
108 | </dd> |
|
|
109 | <p></p></dl> |
|
|
110 | <p> |
|
|
111 | </p> |
|
|
112 | <h2><a name="general_api_considerations">General API Considerations</a></h2> |
|
|
113 | <p>All objects (such as terminals, time watchers etc.) are typical |
|
|
114 | reference-to-hash objects. The hash can be used to store anything you |
|
|
115 | like. All members starting with an underscore (such as <code>_ptr</code> or |
|
|
116 | <code>_hook</code>) are reserved for internal uses and must not be accessed or |
|
|
117 | modified).</p> |
|
|
118 | <p>When objects are destroyed on the C++ side, the perl object hashes are |
|
|
119 | emptied, so its best to store related objects such as time watchers and |
|
|
120 | the like inside the terminal object so they get destroyed as soon as the |
|
|
121 | terminal is destroyed.</p> |
56 | <p> |
122 | <p> |
57 | </p> |
123 | </p> |
58 | <h2><a name="hooks">Hooks</a></h2> |
124 | <h2><a name="hooks">Hooks</a></h2> |
59 | <p>The following subroutines can be declared in loaded scripts, and will be called |
125 | <p>The following subroutines can be declared in loaded scripts, and will be called |
60 | whenever the relevant event happens.</p> |
126 | whenever the relevant event happens.</p> |
… | |
… | |
161 | <dt><strong><a name="item_on_refresh_end__24term">on_refresh_end $term</a></strong><br /> |
227 | <dt><strong><a name="item_on_refresh_end__24term">on_refresh_end $term</a></strong><br /> |
162 | </dt> |
228 | </dt> |
163 | <dd> |
229 | <dd> |
164 | Called just after the screen gets redrawn. See <code>on_refresh_begin</code>. |
230 | Called just after the screen gets redrawn. See <code>on_refresh_begin</code>. |
165 | </dd> |
231 | </dd> |
|
|
232 | <p></p> |
|
|
233 | <dt><strong><a name="item_on_keyboard_command__24term_2c__24string">on_keyboard_command $term, $string</a></strong><br /> |
|
|
234 | </dt> |
|
|
235 | <dd> |
|
|
236 | Called whenever the user presses a key combination that has a |
|
|
237 | <code>perl:string</code> action bound to it (see description of the <strong>keysym</strong> |
|
|
238 | resource in the <code>rxvt(1)</code> manpage). |
|
|
239 | </dd> |
166 | <p></p></dl> |
240 | <p></p></dl> |
167 | <p> |
241 | <p> |
168 | </p> |
242 | </p> |
169 | <h2><a name="functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></h2> |
243 | <h2><a name="functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></h2> |
170 | <dl> |
244 | <dl> |
… | |
… | |
177 | </dd> |
251 | </dd> |
178 | <p></p> |
252 | <p></p> |
179 | <dt><strong><a name="item_urxvt_3a_3awarn__24string">urxvt::warn $string</a></strong><br /> |
253 | <dt><strong><a name="item_urxvt_3a_3awarn__24string">urxvt::warn $string</a></strong><br /> |
180 | </dt> |
254 | </dt> |
181 | <dd> |
255 | <dd> |
182 | Calls <code>rxvt_warn</code> witht eh given string which should not include a |
256 | Calls <code>rxvt_warn</code> with the given string which should not include a |
183 | newline. The module also overwrites the <code>warn</code> builtin with a function |
257 | newline. The module also overwrites the <code>warn</code> builtin with a function |
184 | that calls this function. |
258 | that calls this function. |
185 | </dd> |
259 | </dd> |
186 | <dd> |
260 | <dd> |
187 | <p>Using this function has the advantage that its output ends up in the |
261 | <p>Using this function has the advantage that its output ends up in the |
188 | correct place, e.g. on stderr of the connecting urxvtc client.</p> |
262 | correct place, e.g. on stderr of the connecting urxvtc client.</p> |
189 | </dd> |
263 | </dd> |
190 | <p></p> |
264 | <p></p> |
191 | <dt><strong><a name="item__24cellwidth__3d_urxvt_3a_3awcswidth__24string">$cellwidth = urxvt::wcswidth $string</a></strong><br /> |
265 | <dt><strong><a name="item__24time__3d_urxvt_3a_3anow">$time = urxvt::NOW</a></strong><br /> |
|
|
266 | </dt> |
|
|
267 | <dd> |
|
|
268 | Returns the ``current time'' (as per the event loop). |
|
|
269 | </dd> |
|
|
270 | <p></p></dl> |
|
|
271 | <p> |
|
|
272 | </p> |
|
|
273 | <h2><a name="rendition">RENDITION</a></h2> |
|
|
274 | <p>Rendition bitsets contain information about colour, font, font styles and |
|
|
275 | similar information for each screen cell.</p> |
|
|
276 | <p>The following ``macros'' deal with changes in rendition sets. You should |
|
|
277 | never just create a bitset, you should always modify an existing one, |
|
|
278 | as they contain important information required for correct operation of |
|
|
279 | rxvt-unicode.</p> |
|
|
280 | <dl> |
|
|
281 | <dt><strong><a name="item__24rend__3d_urxvt_3a_3adefault_rstyle">$rend = urxvt::DEFAULT_RSTYLE</a></strong><br /> |
|
|
282 | </dt> |
|
|
283 | <dd> |
|
|
284 | Returns the default rendition, as used when the terminal is starting up or |
|
|
285 | being reset. Useful as a base to start when creating renditions. |
|
|
286 | </dd> |
|
|
287 | <p></p> |
|
|
288 | <dt><strong><a name="item__24rend__3d_urxvt_3a_3aoverlay_rstyle">$rend = urxvt::OVERLAY_RSTYLE</a></strong><br /> |
|
|
289 | </dt> |
|
|
290 | <dd> |
|
|
291 | Return the rendition mask used for overlays by default. |
|
|
292 | </dd> |
|
|
293 | <p></p> |
|
|
294 | <dt><strong><a name="item__24rendbit__3d_urxvt_3a_3ars_bold_2c_rs_italic_2c_">$rendbit = urxvt::RS_Bold, RS_Italic, RS_Blink, RS_RVid, RS_Uline</a></strong><br /> |
|
|
295 | </dt> |
|
|
296 | <dd> |
|
|
297 | Return the bit that enabled bold, italic, blink, reverse-video and |
|
|
298 | underline, respectively. To enable such a style, just logically OR it into |
|
|
299 | the bitset. |
|
|
300 | </dd> |
|
|
301 | <p></p> |
|
|
302 | <dt><strong><a name="item__24foreground__3d_urxvt_3a_3aget_basefg__24rend">$foreground = urxvt::GET_BASEFG $rend</a></strong><br /> |
|
|
303 | </dt> |
|
|
304 | <dt><strong><a name="item__24background__3d_urxvt_3a_3aget_basebg__24rend">$background = urxvt::GET_BASEBG $rend</a></strong><br /> |
|
|
305 | </dt> |
|
|
306 | <dd> |
|
|
307 | Return the foreground/background colour index, respectively. |
|
|
308 | </dd> |
|
|
309 | <p></p> |
|
|
310 | <dt><strong><a name="item_set_fgcolor">$rend = urxvt::SET_FGCOLOR ($rend, $new_colour)</a></strong><br /> |
|
|
311 | </dt> |
|
|
312 | <dt><strong><a name="item_set_bgcolor">$rend = urxvt::SET_BGCOLOR ($rend, $new_colour)</a></strong><br /> |
|
|
313 | </dt> |
|
|
314 | <dd> |
|
|
315 | Replace the foreground/background colour in the rendition mask with the |
|
|
316 | specified one. |
|
|
317 | </dd> |
|
|
318 | <p></p> |
|
|
319 | <dt><strong><a name="item_get_custom">$value = urxvt::GET_CUSTOM ($rend)</a></strong><br /> |
|
|
320 | </dt> |
|
|
321 | <dd> |
|
|
322 | Return the ``custom'' value: Every rendition has 5 bits for use by |
|
|
323 | extensions. They can be set and changed as you like and are initially |
|
|
324 | zero. |
|
|
325 | </dd> |
|
|
326 | <p></p> |
|
|
327 | <dt><strong><a name="item_set_custom">$rend = urxvt::SET_CUSTOM ($rend, $new_value)</a></strong><br /> |
|
|
328 | </dt> |
|
|
329 | <dd> |
|
|
330 | Change the custom value. |
|
|
331 | </dd> |
|
|
332 | <p></p></dl> |
|
|
333 | <p> |
|
|
334 | </p> |
|
|
335 | <h2><a name="the_urxvt__term_class">The <code>urxvt::term</code> Class</a></h2> |
|
|
336 | <dl> |
|
|
337 | <dt><strong><a name="item_resource">$value = $term->resource ($name[, $newval])</a></strong><br /> |
|
|
338 | </dt> |
|
|
339 | <dd> |
|
|
340 | Returns the current resource value associated with a given name and |
|
|
341 | optionally sets a new value. Setting values is most useful in the <code>init</code> |
|
|
342 | hook. Unset resources are returned and accepted as <code>undef</code>. |
|
|
343 | </dd> |
|
|
344 | <dd> |
|
|
345 | <p>The new value must be properly encoded to a suitable character encoding |
|
|
346 | before passing it to this method. Similarly, the returned value may need |
|
|
347 | to be converted from the used encoding to text.</p> |
|
|
348 | </dd> |
|
|
349 | <dd> |
|
|
350 | <p>Resource names are as defined in <em>src/rsinc.h</em>. Colours can be specified |
|
|
351 | as resource names of the form <code>color+<index></code>, e.g. <code>color+5</code>. (will |
|
|
352 | likely change).</p> |
|
|
353 | </dd> |
|
|
354 | <dd> |
|
|
355 | <p>Please note that resource strings will currently only be freed when the |
|
|
356 | terminal is destroyed, so changing options frequently will eat memory.</p> |
|
|
357 | </dd> |
|
|
358 | <dd> |
|
|
359 | <p>Here is a a likely non-exhaustive list of resource names, not all of which |
|
|
360 | are supported in every build, please see the source to see the actual |
|
|
361 | list:</p> |
|
|
362 | </dd> |
|
|
363 | <dd> |
|
|
364 | <pre> |
|
|
365 | answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont |
|
|
366 | borderLess color cursorBlink cursorUnderline cutchars delete_key |
|
|
367 | display_name embed ext_bwidth fade font geometry hold iconName |
|
|
368 | imFont imLocale inputMethod insecure int_bwidth intensityStyles |
|
|
369 | italicFont jumpScroll lineSpace loginShell mapAlert menu meta8 modifier |
|
|
370 | mouseWheelScrollPage name pastableTabs path perl_eval perl_ext |
|
|
371 | perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd |
|
|
372 | reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating |
|
|
373 | scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput |
|
|
374 | scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle |
|
|
375 | shade term_name title transparent transparent_all tripleclickwords |
|
|
376 | utmpInhibit visualBell</pre> |
|
|
377 | </dd> |
|
|
378 | <p></p> |
|
|
379 | <dt><strong><a name="item_selection_mark">($row, $col) = $term->selection_mark ([$row, $col])</a></strong><br /> |
|
|
380 | </dt> |
|
|
381 | <dt><strong><a name="item_selection_beg">($row, $col) = $term->selection_beg ([$row, $col])</a></strong><br /> |
|
|
382 | </dt> |
|
|
383 | <dt><strong><a name="item_selection_end">($row, $col) = $term->selection_end ([$row, $col])</a></strong><br /> |
|
|
384 | </dt> |
|
|
385 | <dd> |
|
|
386 | Return the current values of the selection mark, begin or end positions, |
|
|
387 | and optionally set them to new values. |
|
|
388 | </dd> |
|
|
389 | <p></p> |
|
|
390 | <dt><strong><a name="item_selection_grab">$success = $term->selection_grab ($eventtime)</a></strong><br /> |
|
|
391 | </dt> |
|
|
392 | <dd> |
|
|
393 | Try to request the primary selection from the server (for example, as set |
|
|
394 | by the next method). |
|
|
395 | </dd> |
|
|
396 | <p></p> |
|
|
397 | <dt><strong>$oldtext = $term->selection ([$newtext])</strong><br /> |
|
|
398 | </dt> |
|
|
399 | <dd> |
|
|
400 | Return the current selection text and optionally replace it by <code>$newtext</code>. |
|
|
401 | </dd> |
|
|
402 | <dd> |
|
|
403 | <p>#=item $term->overlay ($x, $y, $text) |
|
|
404 | # |
|
|
405 | #Create a simple multi-line overlay box. See the next method for details. |
|
|
406 | # |
|
|
407 | #=cut</p> |
|
|
408 | </dd> |
|
|
409 | <dd> |
|
|
410 | <p>sub urxvt::term::scr_overlay { |
|
|
411 | die; |
|
|
412 | my ($self, $x, $y, $text) = @_;</p> |
|
|
413 | </dd> |
|
|
414 | <dd> |
|
|
415 | <pre> |
|
|
416 | my @lines = split /\n/, $text;</pre> |
|
|
417 | </dd> |
|
|
418 | <dd> |
|
|
419 | <pre> |
|
|
420 | my $w = 0; |
|
|
421 | for (map $self->strwidth ($_), @lines) { |
|
|
422 | $w = $_ if $w < $_; |
|
|
423 | }</pre> |
|
|
424 | </dd> |
|
|
425 | <dd> |
|
|
426 | <pre> |
|
|
427 | $self->scr_overlay_new ($x, $y, $w, scalar @lines); |
|
|
428 | $self->scr_overlay_set (0, $_, $lines[$_]) for 0.. $#lines; |
|
|
429 | }</pre> |
|
|
430 | </dd> |
|
|
431 | <p></p> |
|
|
432 | <dt><strong><a name="item_overlay">$term->overlay ($x, $y, $width, $height[, $rstyle[, $border]])</a></strong><br /> |
|
|
433 | </dt> |
|
|
434 | <dd> |
|
|
435 | Create a new (empty) overlay at the given position with the given |
|
|
436 | width/height. <code>$rstyle</code> defines the initial rendition style |
|
|
437 | (default: <code>OVERLAY_RSTYLE</code>). |
|
|
438 | </dd> |
|
|
439 | <dd> |
|
|
440 | <p>If <code>$border</code> is <code>2</code> (default), then a decorative border will be put |
|
|
441 | around the box.</p> |
|
|
442 | </dd> |
|
|
443 | <dd> |
|
|
444 | <p>If either <code>$x</code> or <code>$y</code> is negative, then this is counted from the |
|
|
445 | right/bottom side, respectively.</p> |
|
|
446 | </dd> |
|
|
447 | <dd> |
|
|
448 | <p>This method returns an urxvt::overlay object. The overlay will be visible |
|
|
449 | as long as the perl object is referenced.</p> |
|
|
450 | </dd> |
|
|
451 | <dd> |
|
|
452 | <p>Currently, the only method on the <code>urxvt::overlay</code> object is <a href="#item_set"><code>set</code></a>:</p> |
|
|
453 | </dd> |
|
|
454 | <p></p> |
|
|
455 | <dt><strong><a name="item_set">$overlay->set ($x, $y, $text, $rend)</a></strong><br /> |
|
|
456 | </dt> |
|
|
457 | <dd> |
|
|
458 | Similar to <a href="#item_row_t"><code>$term->ROW_t</code></a> and <a href="#item_row_r"><code>$term->ROW_r</code></a> in that it puts |
|
|
459 | text in rxvt-unicode's special encoding and an array of rendition values |
|
|
460 | at a specific position inside the overlay. |
|
|
461 | </dd> |
|
|
462 | <p></p> |
|
|
463 | <dt><strong><a name="item_strwidth">$cellwidth = $term->strwidth $string</a></strong><br /> |
192 | </dt> |
464 | </dt> |
193 | <dd> |
465 | <dd> |
194 | Returns the number of screen-cells this string would need. Correctly |
466 | Returns the number of screen-cells this string would need. Correctly |
195 | accounts for wide and combining characters. |
467 | accounts for wide and combining characters. |
196 | </dd> |
468 | </dd> |
197 | <p></p> |
469 | <p></p> |
198 | <dt><strong><a name="item__24time__3d_urxvt_3a_3anow">$time = urxvt::NOW</a></strong><br /> |
470 | <dt><strong><a name="item_locale_encode">$octets = $term->locale_encode $string</a></strong><br /> |
199 | </dt> |
471 | </dt> |
200 | <dd> |
|
|
201 | Returns the ``current time'' (as per the event loop). |
|
|
202 | </dd> |
472 | <dd> |
203 | <p></p></dl> |
473 | Convert the given text string into the corresponding locale encoding. |
204 | <p> |
|
|
205 | </p> |
|
|
206 | <h2><a name="the_urxvt__term_class">The <code>urxvt::term</code> Class</a></h2> |
|
|
207 | <dl> |
|
|
208 | <dt><strong><a name="item_selection_mark">($row, $col) = $term->selection_mark ([$row, $col])</a></strong><br /> |
|
|
209 | </dt> |
|
|
210 | <dt><strong><a name="item_selection_beg">($row, $col) = $term->selection_beg ([$row, $col])</a></strong><br /> |
|
|
211 | </dt> |
|
|
212 | <dt><strong><a name="item_selection_end">($row, $col) = $term->selection_end ([$row, $col])</a></strong><br /> |
|
|
213 | </dt> |
|
|
214 | <dd> |
474 | </dd> |
215 | Return the current values of the selection mark, begin or end positions, |
475 | <p></p> |
216 | and optionally set them to new values. |
476 | <dt><strong><a name="item_locale_decode">$string = $term->locale_decode $octets</a></strong><br /> |
|
|
477 | </dt> |
217 | </dd> |
478 | <dd> |
218 | <p></p> |
479 | Convert the given locale-encoded octets into a perl string. |
219 | <dt><strong><a name="item_selection_grab">$success = $term->selection_grab ($eventtime)</a></strong><br /> |
|
|
220 | </dt> |
|
|
221 | <dd> |
480 | </dd> |
222 | Try to request the primary selection from the server (for example, as set |
481 | <p></p> |
223 | by the next method). |
482 | <dt><strong><a name="item_tt_write">$term->tt_write ($octets)</a></strong><br /> |
|
|
483 | </dt> |
224 | </dd> |
484 | <dd> |
225 | <p></p> |
485 | Write the octets given in <code>$data</code> to the tty (i.e. as program input). To |
226 | <dt><strong><a name="item_selection">$oldtext = $term->selection ([$newtext])</a></strong><br /> |
486 | pass characters instead of octets, you should convert your strings first |
227 | </dt> |
487 | to the locale-specific encoding using <a href="#item_locale_encode"><code>$term->locale_encode</code></a>. |
228 | <dd> |
488 | </dd> |
229 | Return the current selection text and optionally replace it by <code>$newtext</code>. |
489 | <p></p> |
|
|
490 | <dt><strong><a name="item_nrow">$nrow = $term->nrow</a></strong><br /> |
|
|
491 | </dt> |
|
|
492 | <dt><strong><a name="item_ncol">$ncol = $term->ncol</a></strong><br /> |
|
|
493 | </dt> |
230 | </dd> |
494 | <dd> |
231 | <p></p> |
495 | Return the number of rows/columns of the terminal window (i.e. as |
232 | <dt><strong><a name="item_scr_overlay">$term->scr_overlay ($x, $y, $text)</a></strong><br /> |
496 | specified by <code>-geometry</code>, excluding any scrollback). |
233 | </dt> |
|
|
234 | <dd> |
497 | </dd> |
235 | Create a simple multi-line overlay box. See the next method for details. |
498 | <p></p> |
|
|
499 | <dt><strong><a name="item_nsaved">$nsaved = $term->nsaved</a></strong><br /> |
|
|
500 | </dt> |
236 | </dd> |
501 | <dd> |
237 | <p></p> |
502 | Returns the number of lines in the scrollback buffer. |
238 | <dt><strong><a name="item_scr_overlay_new">$term->scr_overlay_new ($x, $y, $width, $height)</a></strong><br /> |
|
|
239 | </dt> |
|
|
240 | <dd> |
503 | </dd> |
241 | Create a new (empty) overlay at the given position with the given |
504 | <p></p> |
242 | width/height. A border will be put around the box. If either <code>$x</code> or |
505 | <dt><strong><a name="item_view_start">$view_start = $term->view_start ([$newvalue])</a></strong><br /> |
243 | <code>$y</code> is negative, then this is counted from the right/bottom side, |
506 | </dt> |
244 | respectively. |
|
|
245 | </dd> |
507 | <dd> |
246 | <p></p> |
508 | Returns the negative row number of the topmost line. Minimum value is |
247 | <dt><strong><a name="item_scr_overlay_off">$term->scr_overlay_off</a></strong><br /> |
509 | <code>0</code>, which displays the normal terminal contents. Larger values scroll |
248 | </dt> |
510 | this many lines into the scrollback buffer. |
249 | <dd> |
511 | </dd> |
250 | Switch the overlay off again. |
512 | <p></p> |
|
|
513 | <dt><strong><a name="item_want_refresh">$term->want_refresh</a></strong><br /> |
|
|
514 | </dt> |
251 | </dd> |
515 | <dd> |
252 | <p></p> |
516 | Requests a screen refresh. At the next opportunity, rxvt-unicode will |
253 | <dt><strong><a name="item_scr_overlay_set_char">$term->scr_overlay_set_char ($x, $y, $char, $rend = OVERLAY_RSTYLE)</a></strong><br /> |
517 | compare the on-screen display with its stored representation. If they |
254 | </dt> |
518 | differ, it redraws the differences. |
255 | <dd> |
519 | </dd> |
256 | Put a single character (specified numerically) at the given overlay |
|
|
257 | position. |
|
|
258 | </dd> |
520 | <dd> |
259 | <p></p> |
521 | <p>Used after changing terminal contents to display them.</p> |
260 | <dt><strong><a name="item_scr_overlay_set">$term->scr_overlay_set ($x, $y, $text)</a></strong><br /> |
|
|
261 | </dt> |
|
|
262 | <dd> |
522 | </dd> |
263 | Write a string at the given position into the overlay. |
523 | <p></p> |
|
|
524 | <dt><strong><a name="item_row_t">$text = $term->ROW_t ($row_number[, $new_text[, $start_col]])</a></strong><br /> |
|
|
525 | </dt> |
|
|
526 | <dd> |
|
|
527 | Returns the text of the entire row with number <code>$row_number</code>. Row <code>0</code> |
|
|
528 | is the topmost terminal line, row <code>$term->$ncol-1</code> is the bottommost |
|
|
529 | terminal line. The scrollback buffer starts at line <code>-1</code> and extends to |
|
|
530 | line <a href="#item_nsaved"><code>-$term->nsaved</code></a>. |
|
|
531 | </dd> |
|
|
532 | <dd> |
|
|
533 | <p>If <code>$new_text</code> is specified, it will replace characters in the current |
|
|
534 | line, starting at column <code>$start_col</code> (default <code>0</code>), which is useful |
|
|
535 | to replace only parts of a line. The font index in the rendition will |
|
|
536 | automatically be updated.</p> |
|
|
537 | </dd> |
|
|
538 | <dd> |
|
|
539 | <p><code>$text</code> is in a special encoding: tabs and wide characters that use more |
|
|
540 | than one cell when displayed are padded with urxvt::NOCHAR characters |
|
|
541 | (<code>chr 65535</code>). Characters with combining characters and other characters |
|
|
542 | that do not fit into the normal tetx encoding will be replaced with |
|
|
543 | characters in the private use area.</p> |
|
|
544 | </dd> |
|
|
545 | <dd> |
|
|
546 | <p>You have to obey this encoding when changing text. The advantage is |
|
|
547 | that <code>substr</code> and similar functions work on screen cells and not on |
|
|
548 | characters.</p> |
|
|
549 | </dd> |
|
|
550 | <dd> |
|
|
551 | <p>The methods <a href="#item_special_encode"><code>$term->special_encode</code></a> and <a href="#item_special_decode"><code>$term->special_decode</code></a> |
|
|
552 | can be used to convert normal strings into this encoding and vice versa.</p> |
|
|
553 | </dd> |
|
|
554 | <p></p> |
|
|
555 | <dt><strong><a name="item_row_r">$rend = $term->ROW_r ($row_number[, $new_rend[, $start_col]])</a></strong><br /> |
|
|
556 | </dt> |
|
|
557 | <dd> |
|
|
558 | Like <a href="#item_row_t"><code>$term->ROW_t</code></a>, but returns an arrayref with rendition |
|
|
559 | bitsets. Rendition bitsets contain information about colour, font, font |
|
|
560 | styles and similar information. See also <a href="#item_row_t"><code>$term->ROW_t</code></a>. |
|
|
561 | </dd> |
|
|
562 | <dd> |
|
|
563 | <p>When setting rendition, the font mask will be ignored.</p> |
|
|
564 | </dd> |
|
|
565 | <dd> |
|
|
566 | <p>See the section on RENDITION, above.</p> |
|
|
567 | </dd> |
|
|
568 | <p></p> |
|
|
569 | <dt><strong><a name="item_row_l">$length = $term->ROW_l ($row_number[, $new_length])</a></strong><br /> |
|
|
570 | </dt> |
|
|
571 | <dd> |
|
|
572 | Returns the number of screen cells that are in use (``the line length''). If |
|
|
573 | it is <code>-1</code>, then the line is part of a multiple-row logical ``line'', which |
|
|
574 | means all characters are in use and it is continued on the next row. |
|
|
575 | </dd> |
|
|
576 | <p></p> |
|
|
577 | <dt><strong><a name="item_special_encode">$text = $term->special_encode $string</a></strong><br /> |
|
|
578 | </dt> |
|
|
579 | <dd> |
|
|
580 | Converts a perl string into the special encoding used by rxvt-unicode, |
|
|
581 | where one character corresponds to one screen cell. See |
|
|
582 | <a href="#item_row_t"><code>$term->ROW_t</code></a> for details. |
|
|
583 | </dd> |
|
|
584 | <p></p> |
|
|
585 | <dt><strong><a name="item_special_decode">$string = $term->special_decode $text</a></strong><br /> |
|
|
586 | </dt> |
|
|
587 | <dd> |
|
|
588 | Converts rxvt-unicodes text reprsentation into a perl string. See |
|
|
589 | <a href="#item_row_t"><code>$term->ROW_t</code></a> for details. |
264 | </dd> |
590 | </dd> |
265 | <p></p></dl> |
591 | <p></p></dl> |
266 | <p> |
592 | <p> |
267 | </p> |
593 | </p> |
268 | <h2><a name="the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></h2> |
594 | <h2><a name="the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></h2> |
269 | <p>This class implements timer watchers/events. Time is represented as a |
595 | <p>This class implements timer watchers/events. Time is represented as a |
270 | fractional number of seconds since the epoch. Example:</p> |
596 | fractional number of seconds since the epoch. Example:</p> |
271 | <pre> |
597 | <pre> |
272 | # create a digital clock display in upper right corner |
598 | $term->{overlay} = $term->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0); |
273 | $term->{timer} = urxvt::timer |
599 | $term->{timer} = urxvt::timer |
274 | ->new |
600 | ->new |
275 | ->start (urxvt::NOW) |
601 | ->interval (1) |
276 | ->cb (sub { |
602 | ->cb (sub { |
277 | my ($timer) = @_; |
|
|
278 | my $time = $timer->at; |
|
|
279 | $timer->start ($time + 1); |
|
|
280 | $self->scr_overlay (-1, 0, |
603 | $term->{overlay}->set (0, 0, |
281 | POSIX::strftime "%H:%M:%S", localtime $time); |
604 | sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]); |
282 | });</pre> |
605 | });</pre> |
283 | <dl> |
606 | <dl> |
284 | <dt><strong><a name="item__24timer__3d_new_urxvt_3a_3atimer">$timer = new urxvt::timer</a></strong><br /> |
607 | <dt><strong><a name="item__24timer__3d_new_urxvt_3a_3atimer">$timer = new urxvt::timer</a></strong><br /> |
285 | </dt> |
608 | </dt> |
286 | <dd> |
609 | <dd> |
287 | Create a new timer object in stopped state. |
610 | Create a new timer object in started state. It is scheduled to fire |
|
|
611 | immediately. |
288 | </dd> |
612 | </dd> |
289 | <p></p> |
613 | <p></p> |
290 | <dt><strong><a name="item_cb">$timer = $timer->cb (sub { my ($timer) = @_; ... })</a></strong><br /> |
614 | <dt><strong><a name="item_cb">$timer = $timer->cb (sub { my ($timer) = @_; ... })</a></strong><br /> |
291 | </dt> |
615 | </dt> |
292 | <dd> |
616 | <dd> |
… | |
… | |
297 | </dt> |
621 | </dt> |
298 | <dd> |
622 | <dd> |
299 | Return the time this watcher will fire next. |
623 | Return the time this watcher will fire next. |
300 | </dd> |
624 | </dd> |
301 | <p></p> |
625 | <p></p> |
302 | <dt><strong><a name="item_set">$timer = $timer->set ($tstamp)</a></strong><br /> |
626 | <dt><strong>$timer = $timer->set ($tstamp)</strong><br /> |
303 | </dt> |
627 | </dt> |
304 | <dd> |
628 | <dd> |
305 | Set the time the event is generated to $tstamp. |
629 | Set the time the event is generated to $tstamp. |
|
|
630 | </dd> |
|
|
631 | <p></p> |
|
|
632 | <dt><strong><a name="item_interval">$timer = $timer->interval ($interval)</a></strong><br /> |
|
|
633 | </dt> |
|
|
634 | <dd> |
|
|
635 | Normally (and when <code>$interval</code> is <code>0</code>), the timer will automatically |
|
|
636 | stop after it has fired once. If <code>$interval</code> is non-zero, then the timer |
|
|
637 | is automatically rescheduled at the given intervals. |
306 | </dd> |
638 | </dd> |
307 | <p></p> |
639 | <p></p> |
308 | <dt><strong><a name="item_start">$timer = $timer->start</a></strong><br /> |
640 | <dt><strong><a name="item_start">$timer = $timer->start</a></strong><br /> |
309 | </dt> |
641 | </dt> |
310 | <dd> |
642 | <dd> |
… | |
… | |
380 | </dd> |
712 | </dd> |
381 | <p></p></dl> |
713 | <p></p></dl> |
382 | <p> |
714 | <p> |
383 | </p> |
715 | </p> |
384 | <hr /> |
716 | <hr /> |
|
|
717 | <h1><a name="environment">ENVIRONMENT</a></h1> |
|
|
718 | <p> |
|
|
719 | </p> |
|
|
720 | <h2><a name="urxvt_perl_verbosity">URXVT_PERL_VERBOSITY</a></h2> |
|
|
721 | <p>This variable controls the verbosity level of the perl extension. Higher |
|
|
722 | numbers indicate more verbose output.</p> |
|
|
723 | <ol> |
|
|
724 | <li><strong><a name="item__2d_only_fatal_messages">- only fatal messages</a></strong><br /> |
|
|
725 | </li> |
|
|
726 | <li><strong><a name="item__2d_script_loading_and_management">- script loading and management</a></strong><br /> |
|
|
727 | </li> |
|
|
728 | <li><strong><a name="item__2d_all_events_received">- all events received</a></strong><br /> |
|
|
729 | </li> |
|
|
730 | </ol> |
|
|
731 | <p> |
|
|
732 | </p> |
|
|
733 | <hr /> |
385 | <h1><a name="author">AUTHOR</a></h1> |
734 | <h1><a name="author">AUTHOR</a></h1> |
386 | <pre> |
735 | <pre> |
387 | Marc Lehmann <pcg@goof.com> |
736 | Marc Lehmann <pcg@goof.com> |
388 | <a href="http://software.schmorp.de/pkg/rxvt-unicode">http://software.schmorp.de/pkg/rxvt-unicode</a></pre> |
737 | <a href="http://software.schmorp.de/pkg/rxvt-unicode">http://software.schmorp.de/pkg/rxvt-unicode</a></pre> |
389 | |
738 | |