… | |
… | |
18 | <ul> |
18 | <ul> |
19 | |
19 | |
20 | <li><a href="#prepackaged_extensions">Prepackaged Extensions</a></li> |
20 | <li><a href="#prepackaged_extensions">Prepackaged Extensions</a></li> |
21 | <li><a href="#general_api_considerations">General API Considerations</a></li> |
21 | <li><a href="#general_api_considerations">General API Considerations</a></li> |
22 | <li><a href="#hooks">Hooks</a></li> |
22 | <li><a href="#hooks">Hooks</a></li> |
|
|
23 | <li><a href="#variables_in_the_urxvt_package">Variables 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="#functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></li> |
24 | <li><a href="#rendition">RENDITION</a></li> |
25 | <li><a href="#rendition">RENDITION</a></li> |
25 | <li><a href="#the_urxvt__term_class">The <code>urxvt::term</code> Class</a></li> |
26 | <li><a href="#the_urxvt__term_class">The <code>urxvt::term</code> Class</a></li> |
26 | <li><a href="#the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></li> |
27 | <li><a href="#the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></li> |
27 | <li><a href="#the_urxvt__iow_class">The <code>urxvt::iow</code> Class</a></li> |
28 | <li><a href="#the_urxvt__iow_class">The <code>urxvt::iow</code> Class</a></li> |
… | |
… | |
78 | rxvt -pe <extensionname></pre> |
79 | rxvt -pe <extensionname></pre> |
79 | <dl> |
80 | <dl> |
80 | <dt><strong><a name="item_selection">selection</a></strong><br /> |
81 | <dt><strong><a name="item_selection">selection</a></strong><br /> |
81 | </dt> |
82 | </dt> |
82 | <dd> |
83 | <dd> |
83 | Miscellaneous selection modifications. |
84 | Intelligent selection. This extension tries to be more intelligent when |
|
|
85 | the user extends selections (double-click). Right now, it tries to select |
|
|
86 | urls and complete shell-quoted arguments, which is very convenient, too, |
|
|
87 | if your <em>ls</em> supports <code>--quoting-style=shell</code>. |
|
|
88 | </dd> |
|
|
89 | <dd> |
|
|
90 | <p>It also offers the following bindable event:</p> |
84 | </dd> |
91 | </dd> |
85 | <dl> |
92 | <dl> |
86 | <dt><strong><a name="item_rot13">rot13</a></strong><br /> |
93 | <dt><strong><a name="item_rot13">rot13</a></strong><br /> |
87 | </dt> |
94 | </dt> |
88 | <dd> |
95 | <dd> |
… | |
… | |
111 | </p> |
118 | </p> |
112 | <h2><a name="general_api_considerations">General API Considerations</a></h2> |
119 | <h2><a name="general_api_considerations">General API Considerations</a></h2> |
113 | <p>All objects (such as terminals, time watchers etc.) are typical |
120 | <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 |
121 | 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 |
122 | 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 |
123 | <code>_hook</code>) are reserved for internal uses and <strong>MUST NOT</strong> be accessed or |
117 | modified).</p> |
124 | modified).</p> |
118 | <p>When objects are destroyed on the C++ side, the perl object hashes are |
125 | <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 |
126 | 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 |
127 | the like inside the terminal object so they get destroyed as soon as the |
121 | terminal is destroyed.</p> |
128 | terminal is destroyed.</p> |
122 | <p> |
129 | <p> |
123 | </p> |
130 | </p> |
124 | <h2><a name="hooks">Hooks</a></h2> |
131 | <h2><a name="hooks">Hooks</a></h2> |
125 | <p>The following subroutines can be declared in loaded scripts, and will be called |
132 | <p>The following subroutines can be declared in loaded scripts, and will be |
126 | whenever the relevant event happens.</p> |
133 | called whenever the relevant event happens.</p> |
|
|
134 | <p>The first argument passed to them is an object private to each terminal |
|
|
135 | and extension package. You can call all <code>urxvt::term</code> methods on it, but |
|
|
136 | its not a real <code>urxvt::term</code> object. Instead, the real <code>urxvt::term</code> |
|
|
137 | object that is shared between all packages is stored in the <code>term</code> |
|
|
138 | member.</p> |
127 | <p>All of them must return a boolean value. If it is true, then the event |
139 | <p>All of them must return a boolean value. If it is true, then the event |
128 | counts as being <em>consumed</em>, and the invocation of other hooks is skipped, |
140 | counts as being <em>consumed</em>, and the invocation of other hooks is skipped, |
129 | and the relevant action might not be carried out by the C++ code.</p> |
141 | and the relevant action might not be carried out by the C++ code.</p> |
130 | <p>When in doubt, return a false value (preferably <code>()</code>).</p> |
142 | <p>When in doubt, return a false value (preferably <code>()</code>).</p> |
131 | <dl> |
143 | <dl> |
… | |
… | |
172 | </dd> |
184 | </dd> |
173 | <dd> |
185 | <dd> |
174 | <p>Returning a true value aborts selection grabbing. It will still be hilighted.</p> |
186 | <p>Returning a true value aborts selection grabbing. It will still be hilighted.</p> |
175 | </dd> |
187 | </dd> |
176 | <p></p> |
188 | <p></p> |
|
|
189 | <dt><strong><a name="item_on_sel_extend__24term">on_sel_extend $term</a></strong><br /> |
|
|
190 | </dt> |
|
|
191 | <dd> |
|
|
192 | Called whenever the user tries to extend the selection (e.g. with a double |
|
|
193 | click) and is either supposed to return false (normal operation), or |
|
|
194 | should extend the selection itelf and return true to suppress the built-in |
|
|
195 | processing. |
|
|
196 | </dd> |
|
|
197 | <dd> |
|
|
198 | <p>See the <em>selection</em> example extension.</p> |
|
|
199 | </dd> |
|
|
200 | <p></p> |
177 | <dt><strong><a name="item_on_focus_in__24term">on_focus_in $term</a></strong><br /> |
201 | <dt><strong><a name="item_on_focus_in__24term">on_focus_in $term</a></strong><br /> |
178 | </dt> |
202 | </dt> |
179 | <dd> |
203 | <dd> |
180 | Called whenever the window gets the keyboard focus, before urxvt does |
204 | Called whenever the window gets the keyboard focus, before urxvt does |
181 | focus in processing. |
205 | focus in processing. |
… | |
… | |
234 | </dt> |
258 | </dt> |
235 | <dd> |
259 | <dd> |
236 | Called whenever the user presses a key combination that has a |
260 | 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> |
261 | <code>perl:string</code> action bound to it (see description of the <strong>keysym</strong> |
238 | resource in the <code>rxvt(1)</code> manpage). |
262 | resource in the <code>rxvt(1)</code> manpage). |
|
|
263 | </dd> |
|
|
264 | <p></p></dl> |
|
|
265 | <p> |
|
|
266 | </p> |
|
|
267 | <h2><a name="variables_in_the_urxvt_package">Variables in the <code>urxvt</code> Package</a></h2> |
|
|
268 | <dl> |
|
|
269 | <dt><strong><a name="item__24urxvt_3a_3aterm">$urxvt::TERM</a></strong><br /> |
|
|
270 | </dt> |
|
|
271 | <dd> |
|
|
272 | The current terminal. Whenever a callback/Hook is bein executed, this |
|
|
273 | variable stores the current <code>urxvt::term</code> object. |
239 | </dd> |
274 | </dd> |
240 | <p></p></dl> |
275 | <p></p></dl> |
241 | <p> |
276 | <p> |
242 | </p> |
277 | </p> |
243 | <h2><a name="functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></h2> |
278 | <h2><a name="functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></h2> |
… | |
… | |
447 | <dd> |
482 | <dd> |
448 | <p>This method returns an urxvt::overlay object. The overlay will be visible |
483 | <p>This method returns an urxvt::overlay object. The overlay will be visible |
449 | as long as the perl object is referenced.</p> |
484 | as long as the perl object is referenced.</p> |
450 | </dd> |
485 | </dd> |
451 | <dd> |
486 | <dd> |
452 | <p>Currently, the only method on the <code>urxvt::overlay</code> object is <a href="#item_set"><code>set</code></a>:</p> |
487 | <p>The methods currently supported on <code>urxvt::overlay</code> objects are:</p> |
453 | </dd> |
488 | </dd> |
454 | <p></p> |
489 | <dl> |
455 | <dt><strong><a name="item_set">$overlay->set ($x, $y, $text, $rend)</a></strong><br /> |
490 | <dt><strong><a name="item_set">$overlay->set ($x, $y, $text, $rend)</a></strong><br /> |
456 | </dt> |
491 | </dt> |
457 | <dd> |
492 | <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 |
493 | 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 |
494 | text in rxvt-unicode's special encoding and an array of rendition values |
460 | at a specific position inside the overlay. |
495 | at a specific position inside the overlay. |
461 | </dd> |
496 | </dd> |
462 | <p></p> |
497 | <p></p> |
|
|
498 | <dt><strong><a name="item_hide">$overlay->hide</a></strong><br /> |
|
|
499 | </dt> |
|
|
500 | <dd> |
|
|
501 | If visible, hide the overlay, but do not destroy it. |
|
|
502 | </dd> |
|
|
503 | <p></p> |
|
|
504 | <dt><strong><a name="item_show">$overlay->show</a></strong><br /> |
|
|
505 | </dt> |
|
|
506 | <dd> |
|
|
507 | If hidden, display the overlay again. |
|
|
508 | </dd> |
|
|
509 | <p></p></dl> |
463 | <dt><strong><a name="item_strwidth">$cellwidth = $term->strwidth $string</a></strong><br /> |
510 | <dt><strong><a name="item_strwidth">$cellwidth = $term->strwidth $string</a></strong><br /> |
464 | </dt> |
511 | </dt> |
465 | <dd> |
512 | <dd> |
466 | Returns the number of screen-cells this string would need. Correctly |
513 | Returns the number of screen-cells this string would need. Correctly |
467 | accounts for wide and combining characters. |
514 | accounts for wide and combining characters. |
… | |
… | |
525 | </dt> |
572 | </dt> |
526 | <dd> |
573 | <dd> |
527 | Returns the text of the entire row with number <code>$row_number</code>. Row <code>0</code> |
574 | 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 |
575 | 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 |
576 | 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>. |
577 | line <a href="#item_nsaved"><code>-$term->nsaved</code></a>. Nothing will be returned if a nonexistent line |
|
|
578 | is requested. |
531 | </dd> |
579 | </dd> |
532 | <dd> |
580 | <dd> |
533 | <p>If <code>$new_text</code> is specified, it will replace characters in the current |
581 | <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 |
582 | 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 |
583 | to replace only parts of a line. The font index in the rendition will |
… | |
… | |
546 | <p>You have to obey this encoding when changing text. The advantage is |
594 | <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 |
595 | that <code>substr</code> and similar functions work on screen cells and not on |
548 | characters.</p> |
596 | characters.</p> |
549 | </dd> |
597 | </dd> |
550 | <dd> |
598 | <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> |
599 | <p>The methods <code>$term->special_encode</code> 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> |
600 | can be used to convert normal strings into this encoding and vice versa.</p> |
553 | </dd> |
601 | </dd> |
554 | <p></p> |
602 | <p></p> |
555 | <dt><strong><a name="item_row_r">$rend = $term->ROW_r ($row_number[, $new_rend[, $start_col]])</a></strong><br /> |
603 | <dt><strong><a name="item_row_r">$rend = $term->ROW_r ($row_number[, $new_rend[, $start_col]])</a></strong><br /> |
556 | </dt> |
604 | </dt> |
… | |
… | |
567 | </dd> |
615 | </dd> |
568 | <p></p> |
616 | <p></p> |
569 | <dt><strong><a name="item_row_l">$length = $term->ROW_l ($row_number[, $new_length])</a></strong><br /> |
617 | <dt><strong><a name="item_row_l">$length = $term->ROW_l ($row_number[, $new_length])</a></strong><br /> |
570 | </dt> |
618 | </dt> |
571 | <dd> |
619 | <dd> |
572 | Returns the number of screen cells that are in use (``the line length''). If |
620 | Returns the number of screen cells that are in use (``the line |
573 | it is <code>-1</code>, then the line is part of a multiple-row logical ``line'', which |
621 | length''). Unlike the urxvt core, this returns <a href="#item_ncol"><code>$term->ncol</code></a> if the |
574 | means all characters are in use and it is continued on the next row. |
622 | line is joined with the following one. |
|
|
623 | </dd> |
|
|
624 | <p></p> |
|
|
625 | <dt><strong><a name="item_is_longer">$bool = $term->is_longer ($row_number)</a></strong><br /> |
|
|
626 | </dt> |
575 | </dd> |
627 | <dd> |
|
|
628 | Returns true if the row is part of a multiple-row logical ``line'' (i.e. |
|
|
629 | joined with the following row), which means all characters are in use |
|
|
630 | and it is continued on the next row (and possibly a continuation of the |
|
|
631 | previous row(s)). |
|
|
632 | </dd> |
576 | <p></p> |
633 | <p></p> |
|
|
634 | <dt><strong><a name="item_line">$line = $term->line ($row_number)</a></strong><br /> |
|
|
635 | </dt> |
|
|
636 | <dd> |
|
|
637 | Create and return a new <code>urxvt::line</code> object that stores information |
|
|
638 | about the logical line that row <code>$row_number</code> is part of. It supports the |
|
|
639 | following methods: |
|
|
640 | </dd> |
|
|
641 | <dl> |
577 | <dt><strong><a name="item_special_encode">$text = $term->special_encode $string</a></strong><br /> |
642 | <dt><strong><a name="item_t">$text = $line->t</a></strong><br /> |
|
|
643 | </dt> |
|
|
644 | <dd> |
|
|
645 | Returns the full text of the line, similar to <a href="#item_row_t"><code>ROW_t</code></a> |
|
|
646 | </dd> |
|
|
647 | <p></p> |
|
|
648 | <dt><strong><a name="item_r">$rend = $line->r</a></strong><br /> |
|
|
649 | </dt> |
|
|
650 | <dd> |
|
|
651 | Returns the full rendition array of the line, similar to <a href="#item_row_r"><code>ROW_r</code></a> |
|
|
652 | </dd> |
|
|
653 | <p></p> |
|
|
654 | <dt><strong><a name="item_l">$length = $line->l</a></strong><br /> |
|
|
655 | </dt> |
|
|
656 | <dd> |
|
|
657 | Returns the length of the line in cells, similar to <a href="#item_row_l"><code>ROW_l</code></a>. |
|
|
658 | </dd> |
|
|
659 | <p></p> |
|
|
660 | <dt><strong><a name="item_beg">$rownum = $line->beg</a></strong><br /> |
|
|
661 | </dt> |
|
|
662 | <dt><strong><a name="item_end">$rownum = $line->end</a></strong><br /> |
|
|
663 | </dt> |
|
|
664 | <dd> |
|
|
665 | Return the row number of the first/last row of the line, respectively. |
|
|
666 | </dd> |
|
|
667 | <p></p> |
|
|
668 | <dt><strong><a name="item_offset_of">$offset = $line->offset_of ($row, $col)</a></strong><br /> |
|
|
669 | </dt> |
|
|
670 | <dd> |
|
|
671 | Returns the character offset of the given row|col pair within the logical |
|
|
672 | line. |
|
|
673 | </dd> |
|
|
674 | <p></p> |
|
|
675 | <dt><strong><a name="item_coord_of">($row, $col) = $line->coord_of ($offset)</a></strong><br /> |
|
|
676 | </dt> |
|
|
677 | <dd> |
|
|
678 | Translates a string offset into terminal coordinates again. |
|
|
679 | </dd> |
|
|
680 | <p></p></dl> |
|
|
681 | <dt><strong>($row, $col) = $line->coord_of ($offset) |
|
|
682 | =item $text = $term->special_encode $string</strong><br /> |
578 | </dt> |
683 | </dt> |
579 | <dd> |
684 | <dd> |
580 | Converts a perl string into the special encoding used by rxvt-unicode, |
685 | Converts a perl string into the special encoding used by rxvt-unicode, |
581 | where one character corresponds to one screen cell. See |
686 | where one character corresponds to one screen cell. See |
582 | <a href="#item_row_t"><code>$term->ROW_t</code></a> for details. |
687 | <a href="#item_row_t"><code>$term->ROW_t</code></a> for details. |
… | |
… | |
718 | <p> |
823 | <p> |
719 | </p> |
824 | </p> |
720 | <h2><a name="urxvt_perl_verbosity">URXVT_PERL_VERBOSITY</a></h2> |
825 | <h2><a name="urxvt_perl_verbosity">URXVT_PERL_VERBOSITY</a></h2> |
721 | <p>This variable controls the verbosity level of the perl extension. Higher |
826 | <p>This variable controls the verbosity level of the perl extension. Higher |
722 | numbers indicate more verbose output.</p> |
827 | numbers indicate more verbose output.</p> |
723 | <ol> |
828 | <dl> |
724 | <li><strong><a name="item__2d_only_fatal_messages">- only fatal messages</a></strong><br /> |
829 | <dt><strong><a name="item__3d0__2d_only_fatal_messages">=0 - only fatal messages</a></strong><br /> |
725 | </li> |
830 | </dt> |
726 | <li><strong><a name="item__2d_script_loading_and_management">- script loading and management</a></strong><br /> |
831 | <dt><strong><a name="item__3d3__2d_script_loading_and_management">=3 - script loading and management</a></strong><br /> |
727 | </li> |
832 | </dt> |
728 | <li><strong><a name="item__2d_all_events_received">- all events received</a></strong><br /> |
833 | <dt><strong><a name="item__3d10__2d_all_events_received">=10 - all events received</a></strong><br /> |
|
|
834 | </dt> |
729 | </li> |
835 | </dl> |
730 | </ol> |
|
|
731 | <p> |
836 | <p> |
732 | </p> |
837 | </p> |
733 | <hr /> |
838 | <hr /> |
734 | <h1><a name="author">AUTHOR</a></h1> |
839 | <h1><a name="author">AUTHOR</a></h1> |
735 | <pre> |
840 | <pre> |