… | |
… | |
28 | <li><a href="#the_urxvt__anyevent_class">The <code>urxvt::anyevent</code> Class</a></li> |
28 | <li><a href="#the_urxvt__anyevent_class">The <code>urxvt::anyevent</code> Class</a></li> |
29 | <li><a href="#the_urxvt__term_class">The <code>urxvt::term</code> Class</a></li> |
29 | <li><a href="#the_urxvt__term_class">The <code>urxvt::term</code> Class</a></li> |
30 | <li><a href="#the_urxvt__popup_class">The <code>urxvt::popup</code> Class</a></li> |
30 | <li><a href="#the_urxvt__popup_class">The <code>urxvt::popup</code> Class</a></li> |
31 | <li><a href="#the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></li> |
31 | <li><a href="#the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></li> |
32 | <li><a href="#the_urxvt__iow_class">The <code>urxvt::iow</code> Class</a></li> |
32 | <li><a href="#the_urxvt__iow_class">The <code>urxvt::iow</code> Class</a></li> |
|
|
33 | <li><a href="#the_urxvt__iw_class">The <code>urxvt::iw</code> Class</a></li> |
|
|
34 | <li><a href="#the_urxvt__pw_class">The <code>urxvt::pw</code> Class</a></li> |
33 | </ul> |
35 | </ul> |
34 | |
36 | |
35 | <li><a href="#environment">ENVIRONMENT</a></li> |
37 | <li><a href="#environment">ENVIRONMENT</a></li> |
36 | <ul> |
38 | <ul> |
37 | |
39 | |
… | |
… | |
80 | <p>This section describes the extensions delivered with this release. You can |
82 | <p>This section describes the extensions delivered with this release. You can |
81 | find them in <em>/opt/rxvt/lib/urxvt/perl/</em>.</p> |
83 | find them in <em>/opt/rxvt/lib/urxvt/perl/</em>.</p> |
82 | <p>You can activate them like this:</p> |
84 | <p>You can activate them like this:</p> |
83 | <pre> |
85 | <pre> |
84 | rxvt -pe <extensionname></pre> |
86 | rxvt -pe <extensionname></pre> |
|
|
87 | <p>Or by adding them to the resource for extensions loaded by default:</p> |
|
|
88 | <pre> |
|
|
89 | URxvt.perl-ext-common: default,automove-background,selection-autotransform</pre> |
85 | <dl> |
90 | <dl> |
86 | <dt><strong><a name="item_selection">selection (enabled by default)</a></strong><br /> |
91 | <dt><strong><a name="item_selection">selection (enabled by default)</a></strong><br /> |
87 | </dt> |
92 | </dt> |
88 | <dd> |
93 | <dd> |
89 | (More) intelligent selection. This extension tries to be more intelligent |
94 | (More) intelligent selection. This extension tries to be more intelligent |
… | |
… | |
239 | </dd> |
244 | </dd> |
240 | <dd> |
245 | <dd> |
241 | <p>The first line tells the selection code to treat the unchanging part of |
246 | <p>The first line tells the selection code to treat the unchanging part of |
242 | every error message as a selection pattern, and the second line transforms |
247 | every error message as a selection pattern, and the second line transforms |
243 | the message into vi commands to load the file.</p> |
248 | the message into vi commands to load the file.</p> |
|
|
249 | </dd> |
|
|
250 | <p></p> |
|
|
251 | <dt><strong><a name="item_tabbed">tabbed</a></strong><br /> |
|
|
252 | </dt> |
|
|
253 | <dd> |
|
|
254 | This transforms the terminal into a tabbar with additional terminals, that |
|
|
255 | is, it implements what is commonly refered to as ``tabbed terminal''. The topmost line |
|
|
256 | displays a ``[NEW]'' button, which, when clicked, will add a new tab, followed by one |
|
|
257 | button per tab. |
|
|
258 | </dd> |
|
|
259 | <dd> |
|
|
260 | <p>Clicking a button will activate that tab. Pressing Shift-Left and |
|
|
261 | Shift-Right will switch to the tab left or right of the current one.</p> |
244 | </dd> |
262 | </dd> |
245 | <p></p> |
263 | <p></p> |
246 | <dt><strong><a name="item_mark_2durls">mark-urls</a></strong><br /> |
264 | <dt><strong><a name="item_mark_2durls">mark-urls</a></strong><br /> |
247 | </dt> |
265 | </dt> |
248 | <dd> |
266 | <dd> |
… | |
… | |
408 | <h2><a name="hooks">Hooks</a></h2> |
426 | <h2><a name="hooks">Hooks</a></h2> |
409 | <p>The following subroutines can be declared in extension files, and will be |
427 | <p>The following subroutines can be declared in extension files, and will be |
410 | called whenever the relevant event happens.</p> |
428 | called whenever the relevant event happens.</p> |
411 | <p>The first argument passed to them is an extension oject as described in |
429 | <p>The first argument passed to them is an extension oject as described in |
412 | the in the <code>Extension Objects</code> section.</p> |
430 | the in the <code>Extension Objects</code> section.</p> |
413 | <p><strong>All</strong> of these hooks must return a boolean value. If it is true, then the |
431 | <p><strong>All</strong> of these hooks must return a boolean value. If any of the called |
414 | event counts as being <em>consumed</em>, and the invocation of other hooks is |
432 | hooks returns true, then the event counts as being <em>consumed</em>, and the |
415 | skipped, and the relevant action might not be carried out by the C++ code.</p> |
433 | relevant action might not be carried out by the C++ code.</p> |
416 | <p><em>When in doubt, return a false value (preferably <code>()</code>). </em>></p> |
434 | <p><em>When in doubt, return a false value (preferably <code>()</code>). </em>></p> |
417 | <dl> |
435 | <dl> |
418 | <dt><strong><a name="item_on_init__24term">on_init $term</a></strong><br /> |
436 | <dt><strong><a name="item_on_init__24term">on_init $term</a></strong><br /> |
419 | </dt> |
437 | </dt> |
420 | <dd> |
438 | <dd> |
421 | Called after a new terminal object has been initialized, but before |
439 | Called after a new terminal object has been initialized, but before |
422 | windows are created or the command gets run. Most methods are unsafe to |
440 | windows are created or the command gets run. Most methods are unsafe to |
423 | call or deliver senseless data, as terminal size and other characteristics |
441 | call or deliver senseless data, as terminal size and other characteristics |
424 | have not yet been determined. You can safely query and change resources, |
442 | have not yet been determined. You can safely query and change resources |
425 | though. |
443 | and options, though. For many purposes the <code>on_start</code> hook is a better |
|
|
444 | place. |
|
|
445 | </dd> |
|
|
446 | <p></p> |
|
|
447 | <dt><strong><a name="item_on_start__24term">on_start $term</a></strong><br /> |
|
|
448 | </dt> |
|
|
449 | <dd> |
|
|
450 | Called at the very end of initialisation of a new terminal, just before |
|
|
451 | trying to map (display) the toplevel and returning to the mainloop. |
|
|
452 | </dd> |
|
|
453 | <p></p> |
|
|
454 | <dt><strong><a name="item_on_destroy__24term">on_destroy $term</a></strong><br /> |
|
|
455 | </dt> |
|
|
456 | <dd> |
|
|
457 | Called whenever something tries to destroy terminal, before doing anything |
|
|
458 | yet. If this hook returns true, then destruction is skipped, but this is |
|
|
459 | rarely a good idea. |
426 | </dd> |
460 | </dd> |
427 | <p></p> |
461 | <p></p> |
428 | <dt><strong><a name="item_on_reset__24term">on_reset $term</a></strong><br /> |
462 | <dt><strong><a name="item_on_reset__24term">on_reset $term</a></strong><br /> |
429 | </dt> |
463 | </dt> |
430 | <dd> |
464 | <dd> |
431 | Called after the screen is ``reset'' for any reason, such as resizing or |
465 | Called after the screen is ``reset'' for any reason, such as resizing or |
432 | control sequences. Here is where you can react on changes to size-related |
466 | control sequences. Here is where you can react on changes to size-related |
433 | variables. |
467 | variables. |
434 | </dd> |
|
|
435 | <p></p> |
|
|
436 | <dt><strong><a name="item_on_start__24term">on_start $term</a></strong><br /> |
|
|
437 | </dt> |
|
|
438 | <dd> |
|
|
439 | Called at the very end of initialisation of a new terminal, just before |
|
|
440 | returning to the mainloop. |
|
|
441 | </dd> |
468 | </dd> |
442 | <p></p> |
469 | <p></p> |
443 | <dt><strong><a name="item_on_child_start__24term_2c__24pid">on_child_start $term, $pid</a></strong><br /> |
470 | <dt><strong><a name="item_on_child_start__24term_2c__24pid">on_child_start $term, $pid</a></strong><br /> |
444 | </dt> |
471 | </dt> |
445 | <dd> |
472 | <dd> |
… | |
… | |
637 | output, if any, in locale-specific encoding.</p> |
664 | output, if any, in locale-specific encoding.</p> |
638 | </dd> |
665 | </dd> |
639 | <dd> |
666 | <dd> |
640 | <p>subwindow.</p> |
667 | <p>subwindow.</p> |
641 | </dd> |
668 | </dd> |
|
|
669 | <p></p> |
|
|
670 | <dt><strong><a name="item_on_client_message__24term_2c__24event">on_client_message $term, $event</a></strong><br /> |
|
|
671 | </dt> |
|
|
672 | <dt><strong><a name="item_on_wm_protocols__24term_2c__24event">on_wm_protocols $term, $event</a></strong><br /> |
|
|
673 | </dt> |
|
|
674 | <dt><strong><a name="item_on_wm_delete_window__24term_2c__24event">on_wm_delete_window $term, $event</a></strong><br /> |
|
|
675 | </dt> |
|
|
676 | <dd> |
|
|
677 | Called when various types of ClientMessage events are received (all with |
|
|
678 | format=32, WM_PROTOCOLS or WM_PROTOCOLS:WM_DELETE_WINDOW). |
|
|
679 | </dd> |
642 | <p></p></dl> |
680 | <p></p></dl> |
643 | <p> |
681 | <p> |
644 | </p> |
682 | </p> |
645 | <h2><a name="variables_in_the_urxvt_package">Variables in the <code>urxvt</code> Package</a></h2> |
683 | <h2><a name="variables_in_the_urxvt_package">Variables in the <code>urxvt</code> Package</a></h2> |
646 | <dl> |
684 | <dl> |
… | |
… | |
666 | <dt><strong><a name="item__24urxvt_3a_3aterm">$urxvt::TERM</a></strong><br /> |
704 | <dt><strong><a name="item__24urxvt_3a_3aterm">$urxvt::TERM</a></strong><br /> |
667 | </dt> |
705 | </dt> |
668 | <dd> |
706 | <dd> |
669 | The current terminal. This variable stores the current <code>urxvt::term</code> |
707 | The current terminal. This variable stores the current <code>urxvt::term</code> |
670 | object, whenever a callback/hook is executing. |
708 | object, whenever a callback/hook is executing. |
|
|
709 | </dd> |
|
|
710 | <p></p> |
|
|
711 | <dt><strong><a name="item__40urxvt_3a_3aterm_init">@urxvt::TERM_INIT</a></strong><br /> |
|
|
712 | </dt> |
|
|
713 | <dd> |
|
|
714 | All coderefs in this array will be called as methods of the next newly |
|
|
715 | created <code>urxvt::term</code> object (during the <code>on_init</code> phase). The array |
|
|
716 | gets cleared before the codereferences that were in it are being executed, |
|
|
717 | so coderefs can push themselves onto it again if they so desire. |
|
|
718 | </dd> |
|
|
719 | <dd> |
|
|
720 | <p>This complements to the perl-eval commandline option, but gets executed |
|
|
721 | first.</p> |
|
|
722 | </dd> |
|
|
723 | <p></p> |
|
|
724 | <dt><strong><a name="item__40urxvt_3a_3aterm_ext">@urxvt::TERM_EXT</a></strong><br /> |
|
|
725 | </dt> |
|
|
726 | <dd> |
|
|
727 | Works similar to <code>@TERM_INIT</code>, but contains perl package/class names, which |
|
|
728 | get registered as normal extensions after calling the hooks in <code>@TERM_INIT</code> |
|
|
729 | but before other extensions. Gets cleared just like <code>@TERM_INIT</code>. |
671 | </dd> |
730 | </dd> |
672 | <p></p></dl> |
731 | <p></p></dl> |
673 | <p> |
732 | <p> |
674 | </p> |
733 | </p> |
675 | <h2><a name="functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></h2> |
734 | <h2><a name="functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></h2> |
… | |
… | |
1541 | Stop watching for events on the given filehandle. |
1600 | Stop watching for events on the given filehandle. |
1542 | </dd> |
1601 | </dd> |
1543 | <p></p></dl> |
1602 | <p></p></dl> |
1544 | <p> |
1603 | <p> |
1545 | </p> |
1604 | </p> |
|
|
1605 | <h2><a name="the_urxvt__iw_class">The <code>urxvt::iw</code> Class</a></h2> |
|
|
1606 | <p>This class implements idle watchers, that get called automatically when |
|
|
1607 | the process is idle. They should return as fast as possible, after doing |
|
|
1608 | some useful work.</p> |
|
|
1609 | <dl> |
|
|
1610 | <dt><strong><a name="item__24iw__3d_new_urxvt_3a_3aiw">$iw = new urxvt::iw</a></strong><br /> |
|
|
1611 | </dt> |
|
|
1612 | <dd> |
|
|
1613 | Create a new idle watcher object in stopped state. |
|
|
1614 | </dd> |
|
|
1615 | <p></p> |
|
|
1616 | <dt><strong>$iw = $iw->cb (sub { my ($iw) = @_; ... })</strong><br /> |
|
|
1617 | </dt> |
|
|
1618 | <dd> |
|
|
1619 | Set the callback to be called when the watcher triggers. |
|
|
1620 | </dd> |
|
|
1621 | <p></p> |
|
|
1622 | <dt><strong>$timer = $timer->start</strong><br /> |
|
|
1623 | </dt> |
|
|
1624 | <dd> |
|
|
1625 | Start the watcher. |
|
|
1626 | </dd> |
|
|
1627 | <p></p> |
|
|
1628 | <dt><strong>$timer = $timer->stop</strong><br /> |
|
|
1629 | </dt> |
|
|
1630 | <dd> |
|
|
1631 | Stop the watcher. |
|
|
1632 | </dd> |
|
|
1633 | <p></p></dl> |
|
|
1634 | <p> |
|
|
1635 | </p> |
|
|
1636 | <h2><a name="the_urxvt__pw_class">The <code>urxvt::pw</code> Class</a></h2> |
|
|
1637 | <p>This class implements process watchers. They create an event whenever a |
|
|
1638 | process exits, after which they stop automatically.</p> |
|
|
1639 | <pre> |
|
|
1640 | my $pid = fork; |
|
|
1641 | ... |
|
|
1642 | $term->{pw} = urxvt::pw |
|
|
1643 | ->new |
|
|
1644 | ->start ($pid) |
|
|
1645 | ->cb (sub { |
|
|
1646 | my ($pw, $exit_status) = @_; |
|
|
1647 | ... |
|
|
1648 | });</pre> |
|
|
1649 | <dl> |
|
|
1650 | <dt><strong><a name="item__24pw__3d_new_urxvt_3a_3apw">$pw = new urxvt::pw</a></strong><br /> |
|
|
1651 | </dt> |
|
|
1652 | <dd> |
|
|
1653 | Create a new process watcher in stopped state. |
|
|
1654 | </dd> |
|
|
1655 | <p></p> |
|
|
1656 | <dt><strong>$pw = $pw->cb (sub { my ($pw, $exit_status) = @_; ... })</strong><br /> |
|
|
1657 | </dt> |
|
|
1658 | <dd> |
|
|
1659 | Set the callback to be called when the timer triggers. |
|
|
1660 | </dd> |
|
|
1661 | <p></p> |
|
|
1662 | <dt><strong>$pw = $timer->start ($pid)</strong><br /> |
|
|
1663 | </dt> |
|
|
1664 | <dd> |
|
|
1665 | Tells the wqtcher to start watching for process <code>$pid</code>. |
|
|
1666 | </dd> |
|
|
1667 | <p></p> |
|
|
1668 | <dt><strong>$pw = $pw->stop</strong><br /> |
|
|
1669 | </dt> |
|
|
1670 | <dd> |
|
|
1671 | Stop the watcher. |
|
|
1672 | </dd> |
|
|
1673 | <p></p></dl> |
|
|
1674 | <p> |
|
|
1675 | </p> |
1546 | <hr /> |
1676 | <hr /> |
1547 | <h1><a name="environment">ENVIRONMENT</a></h1> |
1677 | <h1><a name="environment">ENVIRONMENT</a></h1> |
1548 | <p> |
1678 | <p> |
1549 | </p> |
1679 | </p> |
1550 | <h2><a name="urxvt_perl_verbosity">URXVT_PERL_VERBOSITY</a></h2> |
1680 | <h2><a name="urxvt_perl_verbosity">URXVT_PERL_VERBOSITY</a></h2> |