… | |
… | |
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 | |
… | |
… | |
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. |
102 | |
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. |
|
|
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 | |
107 | on_focus_out $term |
126 | on_focus_out $term |
… | |
… | |
123 | the total number of lines that will be in the scrollback buffer. |
142 | the total number of lines that will be in the scrollback buffer. |
124 | |
143 | |
125 | on_tty_activity $term *NYI* |
144 | on_tty_activity $term *NYI* |
126 | Called whenever the program(s) running in the urxvt window send |
145 | Called whenever the program(s) running in the urxvt window send |
127 | output. |
146 | output. |
|
|
147 | |
|
|
148 | on_osc_seq $term, $string |
|
|
149 | Called whenever the ESC ] 777 ; string ST command sequence (OSC = |
|
|
150 | operating system command) is processed. Cursor position and other |
|
|
151 | state information is up-to-date when this happens. For |
|
|
152 | interoperability, the string should start with the extension name |
|
|
153 | and a colon, to distinguish it from commands for other extensions, |
|
|
154 | and this might be enforced in the future. |
|
|
155 | |
|
|
156 | Be careful not ever to trust (in a security sense) the data you |
|
|
157 | receive, as its source can not easily be controleld (e-mail content, |
|
|
158 | messages from other users on the same system etc.). |
128 | |
159 | |
129 | on_refresh_begin $term |
160 | on_refresh_begin $term |
130 | Called just before the screen gets redrawn. Can be used for overlay |
161 | Called just before the screen gets redrawn. Can be used for overlay |
131 | or similar effects by modify terminal contents in refresh_begin, and |
162 | or similar effects by modify terminal contents in refresh_begin, and |
132 | restoring them in refresh_end. The built-in overlay and selection |
163 | restoring them in refresh_end. The built-in overlay and selection |
… | |
… | |
138 | on_keyboard_command $term, $string |
169 | on_keyboard_command $term, $string |
139 | Called whenever the user presses a key combination that has a |
170 | Called whenever the user presses a key combination that has a |
140 | "perl:string" action bound to it (see description of the keysym |
171 | "perl:string" action bound to it (see description of the keysym |
141 | resource in the rxvt(1) manpage). |
172 | resource in the rxvt(1) manpage). |
142 | |
173 | |
|
|
174 | Variables in the "urxvt" Package |
|
|
175 | $urxvt::TERM |
|
|
176 | The current terminal. Whenever a callback/Hook is bein executed, |
|
|
177 | this variable stores the current "urxvt::term" object. |
|
|
178 | |
143 | Functions in the "urxvt" Package |
179 | Functions in the "urxvt" Package |
144 | urxvt::fatal $errormessage |
180 | urxvt::fatal $errormessage |
145 | Fatally aborts execution with the given error message. Avoid at all |
181 | Fatally aborts execution with the given error message. Avoid at all |
146 | costs! The only time this is acceptable is when the terminal process |
182 | costs! The only time this is acceptable is when the terminal process |
147 | starts up. |
183 | starts up. |
… | |
… | |
221 | answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont |
257 | answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont |
222 | borderLess color cursorBlink cursorUnderline cutchars delete_key |
258 | borderLess color cursorBlink cursorUnderline cutchars delete_key |
223 | display_name embed ext_bwidth fade font geometry hold iconName |
259 | display_name embed ext_bwidth fade font geometry hold iconName |
224 | imFont imLocale inputMethod insecure int_bwidth intensityStyles |
260 | imFont imLocale inputMethod insecure int_bwidth intensityStyles |
225 | italicFont jumpScroll lineSpace loginShell mapAlert menu meta8 modifier |
261 | italicFont jumpScroll lineSpace loginShell mapAlert menu meta8 modifier |
226 | mouseWheelScrollPage name pastableTabs path perl_eval perl_ext |
262 | mouseWheelScrollPage name pastableTabs path perl_eval perl_ext_1 perl_ext_2 |
227 | perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd |
263 | perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd |
228 | reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating |
264 | reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating |
229 | scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput |
265 | scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput |
230 | scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle |
266 | scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle |
231 | shade term_name title transparent transparent_all tripleclickwords |
267 | shade term_name title transparent transparent_all tripleclickwords |
232 | utmpInhibit visualBell |
268 | utmpInhibit visualBell |
233 | |
269 | |
|
|
270 | $rend = $term->screen_rstyle ([$new_rstyle]) |
|
|
271 | Return and optionally change the current rendition. Text thta is |
|
|
272 | output by the temrianl application will use this style. |
|
|
273 | |
|
|
274 | ($row, $col) = $term->screen_cur ([$row, $col]) |
|
|
275 | Return the current coordinates of the text cursor position and |
|
|
276 | optionally set it (which is usually bad as applications don't expect |
|
|
277 | that). |
|
|
278 | |
234 | ($row, $col) = $term->selection_mark ([$row, $col]) |
279 | ($row, $col) = $term->selection_mark ([$row, $col]) |
235 | ($row, $col) = $term->selection_beg ([$row, $col]) |
280 | ($row, $col) = $term->selection_beg ([$row, $col]) |
236 | ($row, $col) = $term->selection_end ([$row, $col]) |
281 | ($row, $col) = $term->selection_end ([$row, $col]) |
237 | Return the current values of the selection mark, begin or end |
282 | Return the current values of the selection mark, begin or end |
238 | positions, and optionally set them to new values. |
283 | positions, and optionally set them to new values. |
… | |
… | |
273 | right/bottom side, respectively. |
318 | right/bottom side, respectively. |
274 | |
319 | |
275 | This method returns an urxvt::overlay object. The overlay will be |
320 | This method returns an urxvt::overlay object. The overlay will be |
276 | visible as long as the perl object is referenced. |
321 | visible as long as the perl object is referenced. |
277 | |
322 | |
278 | Currently, the only method on the "urxvt::overlay" object is "set": |
323 | The methods currently supported on "urxvt::overlay" objects are: |
279 | |
324 | |
280 | $overlay->set ($x, $y, $text, $rend) |
325 | $overlay->set ($x, $y, $text, $rend) |
281 | Similar to "$term->ROW_t" and "$term->ROW_r" in that it puts text in |
326 | 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 |
327 | text in rxvt-unicode's special encoding and an array of |
283 | a specific position inside the overlay. |
328 | rendition values at a specific position inside the overlay. |
|
|
329 | |
|
|
330 | $overlay->hide |
|
|
331 | If visible, hide the overlay, but do not destroy it. |
|
|
332 | |
|
|
333 | $overlay->show |
|
|
334 | If hidden, display the overlay again. |
284 | |
335 | |
285 | $cellwidth = $term->strwidth $string |
336 | $cellwidth = $term->strwidth $string |
286 | Returns the number of screen-cells this string would need. Correctly |
337 | Returns the number of screen-cells this string would need. Correctly |
287 | accounts for wide and combining characters. |
338 | accounts for wide and combining characters. |
288 | |
339 | |
… | |
… | |
297 | Write the octets given in $data to the tty (i.e. as program input). |
348 | Write the octets given in $data to the tty (i.e. as program input). |
298 | To pass characters instead of octets, you should convert your |
349 | To pass characters instead of octets, you should convert your |
299 | strings first to the locale-specific encoding using |
350 | strings first to the locale-specific encoding using |
300 | "$term->locale_encode". |
351 | "$term->locale_encode". |
301 | |
352 | |
|
|
353 | $window_width = $term->width |
|
|
354 | $window_height = $term->height |
|
|
355 | $font_width = $term->fwidth |
|
|
356 | $font_height = $term->fheight |
|
|
357 | $font_ascent = $term->fbase |
302 | $nrow = $term->nrow |
358 | $terminal_rows = $term->nrow |
303 | $ncol = $term->ncol |
359 | $terminal_columns = $term->ncol |
304 | Return the number of rows/columns of the terminal window (i.e. as |
360 | $has_focus = $term->focus |
305 | specified by "-geometry", excluding any scrollback). |
|
|
306 | |
|
|
307 | $nsaved = $term->nsaved |
361 | $is_mapped = $term->mapped |
308 | Returns the number of lines in the scrollback buffer. |
362 | $max_scrollback = $term->saveLines |
|
|
363 | $nrow_plus_saveLines = $term->total_rows |
|
|
364 | $lines_in_scrollback = $term->nsaved |
|
|
365 | Return various integers describing terminal characteristics. |
309 | |
366 | |
310 | $view_start = $term->view_start ([$newvalue]) |
367 | $view_start = $term->view_start ([$newvalue]) |
311 | Returns the negative row number of the topmost line. Minimum value |
368 | Returns the negative row number of the topmost line. Minimum value |
312 | is 0, which displays the normal terminal contents. Larger values |
369 | is 0, which displays the normal terminal contents. Larger values |
313 | scroll this many lines into the scrollback buffer. |
370 | scroll this many lines into the scrollback buffer. |
… | |
… | |
321 | |
378 | |
322 | $text = $term->ROW_t ($row_number[, $new_text[, $start_col]]) |
379 | $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 |
380 | 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 |
381 | the topmost terminal line, row "$term->$ncol-1" is the bottommost |
325 | terminal line. The scrollback buffer starts at line -1 and extends |
382 | terminal line. The scrollback buffer starts at line -1 and extends |
326 | to line "-$term->nsaved". |
383 | to line "-$term->nsaved". Nothing will be returned if a nonexistent |
|
|
384 | line is requested. |
327 | |
385 | |
328 | If $new_text is specified, it will replace characters in the current |
386 | 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 |
387 | 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 |
388 | replace only parts of a line. The font index in the rendition will |
331 | automatically be updated. |
389 | automatically be updated. |
… | |
… | |
352 | |
410 | |
353 | See the section on RENDITION, above. |
411 | See the section on RENDITION, above. |
354 | |
412 | |
355 | $length = $term->ROW_l ($row_number[, $new_length]) |
413 | $length = $term->ROW_l ($row_number[, $new_length]) |
356 | Returns the number of screen cells that are in use ("the line |
414 | 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 |
415 | length"). Unlike the urxvt core, this returns "$term->ncol" if the |
358 | logical "line", which means all characters are in use and it is |
416 | line is joined with the following one. |
359 | continued on the next row. |
|
|
360 | |
417 | |
|
|
418 | $bool = $term->is_longer ($row_number) |
|
|
419 | Returns true if the row is part of a multiple-row logical "line" |
|
|
420 | (i.e. joined with the following row), which means all characters are |
|
|
421 | in use and it is continued on the next row (and possibly a |
|
|
422 | continuation of the previous row(s)). |
|
|
423 | |
|
|
424 | $line = $term->line ($row_number) |
|
|
425 | Create and return a new "urxvt::line" object that stores information |
|
|
426 | about the logical line that row $row_number is part of. It supports |
|
|
427 | the following methods: |
|
|
428 | |
|
|
429 | $text = $line->t |
|
|
430 | Returns the full text of the line, similar to "ROW_t" |
|
|
431 | |
|
|
432 | $rend = $line->r |
|
|
433 | Returns the full rendition array of the line, similar to "ROW_r" |
|
|
434 | |
|
|
435 | $length = $line->l |
|
|
436 | Returns the length of the line in cells, similar to "ROW_l". |
|
|
437 | |
|
|
438 | $rownum = $line->beg |
|
|
439 | $rownum = $line->end |
|
|
440 | Return the row number of the first/last row of the line, |
|
|
441 | respectively. |
|
|
442 | |
|
|
443 | $offset = $line->offset_of ($row, $col) |
|
|
444 | Returns the character offset of the given row|col pair within |
|
|
445 | the logical line. |
|
|
446 | |
|
|
447 | ($row, $col) = $line->coord_of ($offset) |
|
|
448 | Translates a string offset into terminal coordinates again. |
|
|
449 | |
|
|
450 | ($row, $col) = $line->coord_of ($offset) =item $text = |
361 | $text = $term->special_encode $string |
451 | $term->special_encode $string |
362 | Converts a perl string into the special encoding used by |
452 | Converts a perl string into the special encoding used by |
363 | rxvt-unicode, where one character corresponds to one screen cell. |
453 | rxvt-unicode, where one character corresponds to one screen cell. |
364 | See "$term->ROW_t" for details. |
454 | See "$term->ROW_t" for details. |
365 | |
455 | |
366 | $string = $term->special_decode $text |
456 | $string = $term->special_decode $text |
… | |
… | |
446 | ENVIRONMENT |
536 | ENVIRONMENT |
447 | URXVT_PERL_VERBOSITY |
537 | URXVT_PERL_VERBOSITY |
448 | This variable controls the verbosity level of the perl extension. Higher |
538 | This variable controls the verbosity level of the perl extension. Higher |
449 | numbers indicate more verbose output. |
539 | numbers indicate more verbose output. |
450 | |
540 | |
451 | 0 - only fatal messages |
541 | =0 - only fatal messages |
452 | 3 - script loading and management |
542 | =3 - script loading and management |
453 | 10 - all events received |
543 | =10 - all events received |
454 | |
544 | |
455 | AUTHOR |
545 | AUTHOR |
456 | Marc Lehmann <pcg@goof.com> |
546 | Marc Lehmann <pcg@goof.com> |
457 | http://software.schmorp.de/pkg/rxvt-unicode |
547 | http://software.schmorp.de/pkg/rxvt-unicode |
458 | |
548 | |