… | |
… | |
30 | You can activate them like this: |
30 | You can activate them like this: |
31 | |
31 | |
32 | rxvt -pe <extensionname> |
32 | rxvt -pe <extensionname> |
33 | |
33 | |
34 | selection |
34 | selection |
35 | Miscellaneous selection modifications. |
35 | Intelligent selection. This extension tries to be more intelligent |
|
|
36 | when the user extends selections (double-click). Right now, it tries |
|
|
37 | to select urls and complete shell-quoted arguments, which is very |
|
|
38 | convenient, too, if your ls supports "--quoting-style=shell". |
|
|
39 | |
|
|
40 | It also offers the following bindable event: |
36 | |
41 | |
37 | rot13 |
42 | rot13 |
38 | Rot-13 the selection when activated. Used via keyboard trigger: |
43 | Rot-13 the selection when activated. Used via keyboard trigger: |
39 | |
44 | |
40 | URxvt.keysym.C-M-r: perl:selection:rot13 |
45 | URxvt.keysym.C-M-r: perl:selection:rot13 |
… | |
… | |
49 | |
54 | |
50 | General API Considerations |
55 | General API Considerations |
51 | All objects (such as terminals, time watchers etc.) are typical |
56 | All objects (such as terminals, time watchers etc.) are typical |
52 | reference-to-hash objects. The hash can be used to store anything you |
57 | reference-to-hash objects. The hash can be used to store anything you |
53 | like. All members starting with an underscore (such as "_ptr" or |
58 | like. All members starting with an underscore (such as "_ptr" or |
54 | "_hook") are reserved for internal uses and must not be accessed or |
59 | "_hook") are reserved for internal uses and MUST NOT be accessed or |
55 | modified). |
60 | modified). |
56 | |
61 | |
57 | When objects are destroyed on the C++ side, the perl object hashes are |
62 | When objects are destroyed on the C++ side, the perl object hashes are |
58 | emptied, so its best to store related objects such as time watchers and |
63 | emptied, so its best to store related objects such as time watchers and |
59 | the like inside the terminal object so they get destroyed as soon as the |
64 | the like inside the terminal object so they get destroyed as soon as the |
… | |
… | |
61 | |
66 | |
62 | Hooks |
67 | Hooks |
63 | The following subroutines can be declared in loaded scripts, and will be |
68 | The following subroutines can be declared in loaded scripts, and will be |
64 | called whenever the relevant event happens. |
69 | called whenever the relevant event happens. |
65 | |
70 | |
|
|
71 | The first argument passed to them is an object private to each terminal |
|
|
72 | and extension package. You can call all "urxvt::term" methods on it, but |
|
|
73 | its not a real "urxvt::term" object. Instead, the real "urxvt::term" |
|
|
74 | object that is shared between all packages is stored in the "term" |
|
|
75 | member. |
|
|
76 | |
66 | All of them must return a boolean value. If it is true, then the event |
77 | All of them must return a boolean value. If it is true, then the event |
67 | counts as being *consumed*, and the invocation of other hooks is |
78 | counts as being *consumed*, and the invocation of other hooks is |
68 | skipped, and the relevant action might not be carried out by the C++ |
79 | skipped, and the relevant action might not be carried out by the C++ |
69 | code. |
80 | code. |
70 | |
81 | |
… | |
… | |
97 | selection is requested from the server. The selection text can be |
108 | selection is requested from the server. The selection text can be |
98 | queried and changed by calling "$term->selection". |
109 | queried and changed by calling "$term->selection". |
99 | |
110 | |
100 | Returning a true value aborts selection grabbing. It will still be |
111 | Returning a true value aborts selection grabbing. It will still be |
101 | hilighted. |
112 | hilighted. |
|
|
113 | |
|
|
114 | on_sel_extend $term |
|
|
115 | Called whenever the user tries to extend the selection (e.g. with a |
|
|
116 | double click) and is either supposed to return false (normal |
|
|
117 | operation), or should extend the selection itelf and return true to |
|
|
118 | suppress the built-in processing. |
|
|
119 | |
|
|
120 | See the selection example extension. |
102 | |
121 | |
103 | on_focus_in $term |
122 | on_focus_in $term |
104 | Called whenever the window gets the keyboard focus, before urxvt |
123 | Called whenever the window gets the keyboard focus, before urxvt |
105 | does focus in processing. |
124 | does focus in processing. |
106 | |
125 | |
… | |
… | |
137 | |
156 | |
138 | on_keyboard_command $term, $string |
157 | on_keyboard_command $term, $string |
139 | Called whenever the user presses a key combination that has a |
158 | Called whenever the user presses a key combination that has a |
140 | "perl:string" action bound to it (see description of the keysym |
159 | "perl:string" action bound to it (see description of the keysym |
141 | resource in the rxvt(1) manpage). |
160 | resource in the rxvt(1) manpage). |
|
|
161 | |
|
|
162 | Variables in the "urxvt" Package |
|
|
163 | $urxvt::TERM |
|
|
164 | The current terminal. Whenever a callback/Hook is bein executed, |
|
|
165 | this variable stores the current "urxvt::term" object. |
142 | |
166 | |
143 | Functions in the "urxvt" Package |
167 | Functions in the "urxvt" Package |
144 | urxvt::fatal $errormessage |
168 | urxvt::fatal $errormessage |
145 | Fatally aborts execution with the given error message. Avoid at all |
169 | Fatally aborts execution with the given error message. Avoid at all |
146 | costs! The only time this is acceptable is when the terminal process |
170 | costs! The only time this is acceptable is when the terminal process |
… | |
… | |
273 | right/bottom side, respectively. |
297 | right/bottom side, respectively. |
274 | |
298 | |
275 | This method returns an urxvt::overlay object. The overlay will be |
299 | This method returns an urxvt::overlay object. The overlay will be |
276 | visible as long as the perl object is referenced. |
300 | visible as long as the perl object is referenced. |
277 | |
301 | |
278 | Currently, the only method on the "urxvt::overlay" object is "set": |
302 | The methods currently supported on "urxvt::overlay" objects are: |
279 | |
303 | |
280 | $overlay->set ($x, $y, $text, $rend) |
304 | $overlay->set ($x, $y, $text, $rend) |
281 | Similar to "$term->ROW_t" and "$term->ROW_r" in that it puts text in |
305 | Similar to "$term->ROW_t" and "$term->ROW_r" in that it puts |
282 | rxvt-unicode's special encoding and an array of rendition values at |
306 | text in rxvt-unicode's special encoding and an array of |
283 | a specific position inside the overlay. |
307 | rendition values at a specific position inside the overlay. |
|
|
308 | |
|
|
309 | $overlay->hide |
|
|
310 | If visible, hide the overlay, but do not destroy it. |
|
|
311 | |
|
|
312 | $overlay->show |
|
|
313 | If hidden, display the overlay again. |
284 | |
314 | |
285 | $cellwidth = $term->strwidth $string |
315 | $cellwidth = $term->strwidth $string |
286 | Returns the number of screen-cells this string would need. Correctly |
316 | Returns the number of screen-cells this string would need. Correctly |
287 | accounts for wide and combining characters. |
317 | accounts for wide and combining characters. |
288 | |
318 | |
… | |
… | |
321 | |
351 | |
322 | $text = $term->ROW_t ($row_number[, $new_text[, $start_col]]) |
352 | $text = $term->ROW_t ($row_number[, $new_text[, $start_col]]) |
323 | Returns the text of the entire row with number $row_number. Row 0 is |
353 | Returns the text of the entire row with number $row_number. Row 0 is |
324 | the topmost terminal line, row "$term->$ncol-1" is the bottommost |
354 | the topmost terminal line, row "$term->$ncol-1" is the bottommost |
325 | terminal line. The scrollback buffer starts at line -1 and extends |
355 | terminal line. The scrollback buffer starts at line -1 and extends |
326 | to line "-$term->nsaved". |
356 | to line "-$term->nsaved". Nothing will be returned if a nonexistent |
|
|
357 | line is requested. |
327 | |
358 | |
328 | If $new_text is specified, it will replace characters in the current |
359 | If $new_text is specified, it will replace characters in the current |
329 | line, starting at column $start_col (default 0), which is useful to |
360 | line, starting at column $start_col (default 0), which is useful to |
330 | replace only parts of a line. The font index in the rendition will |
361 | replace only parts of a line. The font index in the rendition will |
331 | automatically be updated. |
362 | automatically be updated. |
… | |
… | |
352 | |
383 | |
353 | See the section on RENDITION, above. |
384 | See the section on RENDITION, above. |
354 | |
385 | |
355 | $length = $term->ROW_l ($row_number[, $new_length]) |
386 | $length = $term->ROW_l ($row_number[, $new_length]) |
356 | Returns the number of screen cells that are in use ("the line |
387 | Returns the number of screen cells that are in use ("the line |
357 | length"). If it is -1, then the line is part of a multiple-row |
388 | length"). Unlike the urxvt core, this returns "$term->ncol" if the |
358 | logical "line", which means all characters are in use and it is |
389 | line is joined with the following one. |
359 | continued on the next row. |
|
|
360 | |
390 | |
|
|
391 | $bool = $term->is_longer ($row_number) |
|
|
392 | Returns true if the row is part of a multiple-row logical "line" |
|
|
393 | (i.e. joined with the following row), which means all characters are |
|
|
394 | in use and it is continued on the next row (and possibly a |
|
|
395 | continuation of the previous row(s)). |
|
|
396 | |
|
|
397 | $line = $term->line ($row_number) |
|
|
398 | Create and return a new "urxvt::line" object that stores information |
|
|
399 | about the logical line that row $row_number is part of. It supports |
|
|
400 | the following methods: |
|
|
401 | |
|
|
402 | $text = $line->t |
|
|
403 | Returns the full text of the line, similar to "ROW_t" |
|
|
404 | |
|
|
405 | $rend = $line->r |
|
|
406 | Returns the full rendition array of the line, similar to "ROW_r" |
|
|
407 | |
|
|
408 | $length = $line->l |
|
|
409 | Returns the length of the line in cells, similar to "ROW_l". |
|
|
410 | |
|
|
411 | $rownum = $line->beg |
|
|
412 | $rownum = $line->end |
|
|
413 | Return the row number of the first/last row of the line, |
|
|
414 | respectively. |
|
|
415 | |
|
|
416 | $offset = $line->offset_of ($row, $col) |
|
|
417 | Returns the character offset of the given row|col pair within |
|
|
418 | the logical line. |
|
|
419 | |
|
|
420 | ($row, $col) = $line->coord_of ($offset) |
|
|
421 | Translates a string offset into terminal coordinates again. |
|
|
422 | |
|
|
423 | ($row, $col) = $line->coord_of ($offset) =item $text = |
361 | $text = $term->special_encode $string |
424 | $term->special_encode $string |
362 | Converts a perl string into the special encoding used by |
425 | Converts a perl string into the special encoding used by |
363 | rxvt-unicode, where one character corresponds to one screen cell. |
426 | rxvt-unicode, where one character corresponds to one screen cell. |
364 | See "$term->ROW_t" for details. |
427 | See "$term->ROW_t" for details. |
365 | |
428 | |
366 | $string = $term->special_decode $text |
429 | $string = $term->special_decode $text |
… | |
… | |
446 | ENVIRONMENT |
509 | ENVIRONMENT |
447 | URXVT_PERL_VERBOSITY |
510 | URXVT_PERL_VERBOSITY |
448 | This variable controls the verbosity level of the perl extension. Higher |
511 | This variable controls the verbosity level of the perl extension. Higher |
449 | numbers indicate more verbose output. |
512 | numbers indicate more verbose output. |
450 | |
513 | |
451 | 0 - only fatal messages |
514 | =0 - only fatal messages |
452 | 3 - script loading and management |
515 | =3 - script loading and management |
453 | 10 - all events received |
516 | =10 - all events received |
454 | |
517 | |
455 | AUTHOR |
518 | AUTHOR |
456 | Marc Lehmann <pcg@goof.com> |
519 | Marc Lehmann <pcg@goof.com> |
457 | http://software.schmorp.de/pkg/rxvt-unicode |
520 | http://software.schmorp.de/pkg/rxvt-unicode |
458 | |
521 | |