517
556
<code>urxvt::term</code> class on this object.</p>
518
557
<p>It has the following methods and data members:</p>
520
<dt><strong><a name="item__24urxvt_term__3d__24self_2d_3e_7bterm_7d">$urxvt_term = $self->{term}</a></strong><br />
559
<dt><strong><a name="item__urxvt_term">$urxvt_term = $self->{term}</a></strong>
523
Returns the <code>urxvt::term</code> object associated with this instance of the
524
extension. This member <em>must not</em> be changed in any way.
562
<p>Returns the <code>urxvt::term</code> object associated with this instance of the
563
extension. This member <em>must not</em> be changed in any way.</p>
527
<dt><strong><a name="item_enable">$self->enable ($hook_name => $cb, [$hook_name => $cb..])</a></strong><br />
566
<dt><strong><a name="item_enable">$self->enable ($hook_name => $cb, [$hook_name => $cb..])</a></strong>
530
Dynamically enable the given hooks (named without the <code>on_</code> prefix) for
569
<p>Dynamically enable the given hooks (named without the <code>on_</code> prefix) for
531
570
this extension, replacing any previous hook. This is useful when you want
532
to overwrite time-critical hooks only temporarily.
571
to overwrite time-critical hooks only temporarily.</p>
535
<dt><strong><a name="item_disable">$self->disable ($hook_name[, $hook_name..])</a></strong><br />
574
<dt><strong><a name="item_disable">$self->disable ($hook_name[, $hook_name..])</a></strong>
538
Dynamically disable the given hooks.
577
<p>Dynamically disable the given hooks.</p>
543
583
<h2><a name="hooks">Hooks</a></h2>
544
584
<p>The following subroutines can be declared in extension files, and will be
545
585
called whenever the relevant event happens.</p>
546
<p>The first argument passed to them is an extension oject as described in
586
<p>The first argument passed to them is an extension object as described in
547
587
the in the <code>Extension Objects</code> section.</p>
548
588
<p><strong>All</strong> of these hooks must return a boolean value. If any of the called
549
589
hooks returns true, then the event counts as being <em>consumed</em>, and the
550
590
relevant action might not be carried out by the C++ code.</p>
551
591
<p><em>When in doubt, return a false value (preferably <code>()</code>). </em>></p>
553
<dt><strong><a name="item_on_init__24term">on_init $term</a></strong><br />
593
<dt><strong><a name="item_on_init__24term">on_init $term</a></strong>
556
Called after a new terminal object has been initialized, but before
596
<p>Called after a new terminal object has been initialized, but before
557
597
windows are created or the command gets run. Most methods are unsafe to
558
598
call or deliver senseless data, as terminal size and other characteristics
559
599
have not yet been determined. You can safely query and change resources
560
600
and options, though. For many purposes the <code>on_start</code> hook is a better
564
<dt><strong><a name="item_on_start__24term">on_start $term</a></strong><br />
567
Called at the very end of initialisation of a new terminal, just before
568
trying to map (display) the toplevel and returning to the mainloop.
571
<dt><strong><a name="item_on_destroy__24term">on_destroy $term</a></strong><br />
574
Called whenever something tries to destroy terminal, when the terminal is
575
still fully functional (not for long, though).
578
<dt><strong><a name="item_on_reset__24term">on_reset $term</a></strong><br />
581
Called after the screen is ``reset'' for any reason, such as resizing or
604
<dt><strong><a name="item_on_start__24term">on_start $term</a></strong>
607
<p>Called at the very end of initialisation of a new terminal, just before
608
trying to map (display) the toplevel and returning to the main loop.</p>
611
<dt><strong><a name="item_on_destroy__24term">on_destroy $term</a></strong>
614
<p>Called whenever something tries to destroy terminal, when the terminal is
615
still fully functional (not for long, though).</p>
618
<dt><strong><a name="item_on_reset__24term">on_reset $term</a></strong>
621
<p>Called after the screen is ``reset'' for any reason, such as resizing or
582
622
control sequences. Here is where you can react on changes to size-related
586
<dt><strong><a name="item_on_child_start__24term_2c__24pid">on_child_start $term, $pid</a></strong><br />
589
Called just after the child process has been <code>fork</code>ed.
592
<dt><strong><a name="item_on_child_exit__24term_2c__24status">on_child_exit $term, $status</a></strong><br />
595
Called just after the child process has exited. <code>$status</code> is the status
596
from <code>waitpid</code>.
599
<dt><strong><a name="item_on_sel_make__24term_2c__24eventtime">on_sel_make $term, $eventtime</a></strong><br />
602
Called whenever a selection has been made by the user, but before the
626
<dt><strong><a name="item_on_child_start__24term_2c__24pid">on_child_start $term, $pid</a></strong>
629
<p>Called just after the child process has been <code>fork</code>ed.</p>
632
<dt><strong><a name="item_on_child_exit__24term_2c__24status">on_child_exit $term, $status</a></strong>
635
<p>Called just after the child process has exited. <code>$status</code> is the status
636
from <code>waitpid</code>.</p>
639
<dt><strong><a name="item_on_sel_make__24term_2c__24eventtime">on_sel_make $term, $eventtime</a></strong>
642
<p>Called whenever a selection has been made by the user, but before the
603
643
selection text is copied, so changes to the beginning, end or type of the
604
selection will be honored.
644
selection will be honored.</p>
607
647
<p>Returning a true value aborts selection making by urxvt, in which case you
608
648
have to make a selection yourself by calling <a href="#item_selection_grab"><code>$term->selection_grab</code></a>.</p>
611
<dt><strong><a name="item_on_sel_grab__24term_2c__24eventtime">on_sel_grab $term, $eventtime</a></strong><br />
651
<dt><strong><a name="item_on_sel_grab__24term_2c__24eventtime">on_sel_grab $term, $eventtime</a></strong>
614
Called whenever a selection has been copied, but before the selection is
654
<p>Called whenever a selection has been copied, but before the selection is
615
655
requested from the server. The selection text can be queried and changed
616
by calling <a href="#item_selection"><code>$term->selection</code></a>.
619
<p>Returning a true value aborts selection grabbing. It will still be hilighted.</p>
622
<dt><strong><a name="item_on_sel_extend__24term">on_sel_extend $term</a></strong><br />
625
Called whenever the user tries to extend the selection (e.g. with a double
656
by calling <a href="#item_selection"><code>$term->selection</code></a>.</p>
659
<p>Returning a true value aborts selection grabbing. It will still be highlighted.</p>
662
<dt><strong><a name="item_on_sel_extend__24term">on_sel_extend $term</a></strong>
665
<p>Called whenever the user tries to extend the selection (e.g. with a double
626
666
click) and is either supposed to return false (normal operation), or
627
should extend the selection itelf and return true to suppress the built-in
667
should extend the selection itself and return true to suppress the built-in
628
668
processing. This can happen multiple times, as long as the callback
629
669
returns true, it will be called on every further click by the user and is
630
supposed to enlarge the selection more and more, if possible.
670
supposed to enlarge the selection more and more, if possible.</p>
633
673
<p>See the <em>selection</em> example extension.</p>
636
<dt><strong><a name="item_on_view_change__24term_2c__24offset">on_view_change $term, $offset</a></strong><br />
676
<dt><strong><a name="item_on_view_change__24term_2c__24offset">on_view_change $term, $offset</a></strong>
639
Called whenever the view offset changes, i..e the user or program
679
<p>Called whenever the view offset changes, i.e. the user or program
640
680
scrolls. Offset <code>0</code> means display the normal terminal, positive values
641
show this many lines of scrollback.
681
show this many lines of scrollback.</p>
644
<dt><strong><a name="item_on_scroll_back__24term_2c__24lines_2c__24saved">on_scroll_back $term, $lines, $saved</a></strong><br />
684
<dt><strong><a name="item_on_scroll_back__24term_2c__24lines_2c__24saved">on_scroll_back $term, $lines, $saved</a></strong>
647
Called whenever lines scroll out of the terminal area into the scrollback
687
<p>Called whenever lines scroll out of the terminal area into the scrollback
648
688
buffer. <code>$lines</code> is the number of lines scrolled out and may be larger
649
than the scroll back buffer or the terminal.
689
than the scroll back buffer or the terminal.</p>
652
692
<p>It is called before lines are scrolled out (so rows 0 .. min ($lines - 1,
653
693
$nrow - 1) represent the lines to be scrolled out). <code>$saved</code> is the total
654
694
number of lines that will be in the scrollback buffer.</p>
657
<dt><strong><a name="item_on_osc_seq__24term_2c__24string">on_osc_seq $term, $string</a></strong><br />
660
Called whenever the <strong>ESC ] 777 ; string ST</strong> command sequence (OSC =
697
<dt><strong><a name="item_on_osc_seq__24term_2c__24op_2c__24args">on_osc_seq $term, $op, $args</a></strong>
700
<p>Called on every OSC sequence and can be used to suppress it or modify its
701
behaviour. The default should be to return an empty list. A true value
702
suppresses execution of the request completely. Make sure you don't get
703
confused by recursive invocations when you output an osc sequence within
707
<p><code>on_osc_seq_perl</code> should be used for new behaviour.</p>
710
<dt><strong><a name="item_on_osc_seq_perl__24term_2c__24string">on_osc_seq_perl $term, $string</a></strong>
713
<p>Called whenever the <strong>ESC ] 777 ; string ST</strong> command sequence (OSC =
661
714
operating system command) is processed. Cursor position and other state
662
715
information is up-to-date when this happens. For interoperability, the
663
716
string should start with the extension name and a colon, to distinguish
664
717
it from commands for other extensions, and this might be enforced in the
668
721
<p>Be careful not ever to trust (in a security sense) the data you receive,
669
as its source can not easily be controleld (e-mail content, messages from
722
as its source can not easily be controlled (e-mail content, messages from
670
723
other users on the same system etc.).</p>
673
<dt><strong><a name="item_on_add_lines__24term_2c__24string">on_add_lines $term, $string</a></strong><br />
726
<dt><strong><a name="item_on_add_lines__24term_2c__24string">on_add_lines $term, $string</a></strong>
676
Called whenever text is about to be output, with the text as argument. You
729
<p>Called whenever text is about to be output, with the text as argument. You
677
730
can filter/change and output the text yourself by returning a true value
678
731
and calling <a href="#item_scr_add_lines"><code>$term->scr_add_lines</code></a> yourself. Please note that this
679
732
might be very slow, however, as your hook is called for <strong>all</strong> text being
683
<dt><strong><a name="item_on_tt_write__24term_2c__24octets">on_tt_write $term, $octets</a></strong><br />
686
Called whenever some data is written to the tty/pty and can be used to
687
suppress or filter tty input.
690
<dt><strong><a name="item_on_line_update__24term_2c__24row">on_line_update $term, $row</a></strong><br />
693
Called whenever a line was updated or changed. Can be used to filter
736
<dt><strong><a name="item_on_tt_write__24term_2c__24octets">on_tt_write $term, $octets</a></strong>
739
<p>Called whenever some data is written to the tty/pty and can be used to
740
suppress or filter tty input.</p>
743
<dt><strong><a name="item_on_line_update__24term_2c__24row">on_line_update $term, $row</a></strong>
746
<p>Called whenever a line was updated or changed. Can be used to filter
694
747
screen output (e.g. underline urls or other useless stuff). Only lines
695
748
that are being shown will be filtered, and, due to performance reasons,
696
not always immediately.
749
not always immediately.</p>
699
752
<p>The row number is always the topmost row of the line if the line spans
704
757
later with the already-modified line (e.g. if unrelated parts change), so
705
758
you cannot just toggle rendition bits, but only set them.</p>
708
<dt><strong><a name="item_on_refresh_begin__24term">on_refresh_begin $term</a></strong><br />
761
<dt><strong><a name="item_on_refresh_begin__24term">on_refresh_begin $term</a></strong>
711
Called just before the screen gets redrawn. Can be used for overlay
764
<p>Called just before the screen gets redrawn. Can be used for overlay
712
765
or similar effects by modify terminal contents in refresh_begin, and
713
766
restoring them in refresh_end. The built-in overlay and selection display
714
code is run after this hook, and takes precedence.
717
<dt><strong><a name="item_on_refresh_end__24term">on_refresh_end $term</a></strong><br />
720
Called just after the screen gets redrawn. See <code>on_refresh_begin</code>.
723
<dt><strong><a name="item_on_user_command__24term_2c__24string">on_user_command $term, $string</a></strong><br />
726
Called whenever the a user-configured event is being activated (e.g. via
767
code is run after this hook, and takes precedence.</p>
770
<dt><strong><a name="item_on_refresh_end__24term">on_refresh_end $term</a></strong>
773
<p>Called just after the screen gets redrawn. See <code>on_refresh_begin</code>.</p>
776
<dt><strong><a name="item_on_user_command__24term_2c__24string">on_user_command $term, $string</a></strong>
779
<p>Called whenever a user-configured event is being activated (e.g. via
727
780
a <code>perl:string</code> action bound to a key, see description of the <strong>keysym</strong>
728
resource in the <code>rxvt(1)</code> manpage).
781
resource in the <code>rxvt(1)</code> manpage).</p>
731
784
<p>The event is simply the action string. This interface is assumed to change
732
785
slightly in the future.</p>
735
<dt><strong><a name="item_on_resize_all_windows__24tern_2c__24new_width_2c__">on_resize_all_windows $tern, $new_width, $new_height</a></strong><br />
788
<dt><strong><a name="item_on_resize_all_windows__24tern_2c__24new_width_2c__">on_resize_all_windows $tern, $new_width, $new_height</a></strong>
738
Called just after the new window size has been calculcated, but before
791
<p>Called just after the new window size has been calculated, but before
739
792
windows are actually being resized or hints are being set. If this hook
740
returns TRUE, setting of the window hints is being skipped.
793
returns TRUE, setting of the window hints is being skipped.</p>
743
<dt><strong><a name="item_on_x_event__24term_2c__24event">on_x_event $term, $event</a></strong><br />
796
<dt><strong><a name="item_on_x_event__24term_2c__24event">on_x_event $term, $event</a></strong>
746
Called on every X event received on the vt window (and possibly other
799
<p>Called on every X event received on the vt window (and possibly other
747
800
windows). Should only be used as a last resort. Most event structure
748
members are not passed.
751
<dt><strong><a name="item_on_focus_in__24term">on_focus_in $term</a></strong><br />
754
Called whenever the window gets the keyboard focus, before rxvt-unicode
755
does focus in processing.
758
<dt><strong><a name="item_on_focus_out__24term">on_focus_out $term</a></strong><br />
761
Called wheneever the window loses keyboard focus, before rxvt-unicode does
762
focus out processing.
765
<dt><strong><a name="item_on_configure_notify__24term_2c__24event">on_configure_notify $term, $event</a></strong><br />
767
<dt><strong><a name="item_on_property_notify__24term_2c__24event">on_property_notify $term, $event</a></strong><br />
769
<dt><strong><a name="item_on_key_press__24term_2c__24event_2c__24keysym_2c__">on_key_press $term, $event, $keysym, $octets</a></strong><br />
771
<dt><strong><a name="item_on_key_release__24term_2c__24event_2c__24keysym">on_key_release $term, $event, $keysym</a></strong><br />
773
<dt><strong><a name="item_on_button_press__24term_2c__24event">on_button_press $term, $event</a></strong><br />
775
<dt><strong><a name="item_on_button_release__24term_2c__24event">on_button_release $term, $event</a></strong><br />
777
<dt><strong><a name="item_on_motion_notify__24term_2c__24event">on_motion_notify $term, $event</a></strong><br />
779
<dt><strong><a name="item_on_map_notify__24term_2c__24event">on_map_notify $term, $event</a></strong><br />
781
<dt><strong><a name="item_on_unmap_notify__24term_2c__24event">on_unmap_notify $term, $event</a></strong><br />
784
Called whenever the corresponding X event is received for the terminal If
785
the hook returns true, then the even will be ignored by rxvt-unicode.
801
members are not passed.</p>
804
<dt><strong><a name="item_on_root_event__24term_2c__24event">on_root_event $term, $event</a></strong>
807
<p>Like <code>on_x_event</code>, but is called for events on the root window.</p>
810
<dt><strong><a name="item_on_focus_in__24term">on_focus_in $term</a></strong>
813
<p>Called whenever the window gets the keyboard focus, before rxvt-unicode
814
does focus in processing.</p>
817
<dt><strong><a name="item_on_focus_out__24term">on_focus_out $term</a></strong>
820
<p>Called whenever the window loses keyboard focus, before rxvt-unicode does
821
focus out processing.</p>
824
<dt><strong><a name="item_on_configure_notify__24term_2c__24event">on_configure_notify $term, $event</a></strong>
826
<dt><strong><a name="item_on_property_notify__24term_2c__24event">on_property_notify $term, $event</a></strong>
828
<dt><strong><a name="item_on_key_press__24term_2c__24event_2c__24keysym_2c__">on_key_press $term, $event, $keysym, $octets</a></strong>
830
<dt><strong><a name="item_on_key_release__24term_2c__24event_2c__24keysym">on_key_release $term, $event, $keysym</a></strong>
832
<dt><strong><a name="item_on_button_press__24term_2c__24event">on_button_press $term, $event</a></strong>
834
<dt><strong><a name="item_on_button_release__24term_2c__24event">on_button_release $term, $event</a></strong>
836
<dt><strong><a name="item_on_motion_notify__24term_2c__24event">on_motion_notify $term, $event</a></strong>
838
<dt><strong><a name="item_on_map_notify__24term_2c__24event">on_map_notify $term, $event</a></strong>
840
<dt><strong><a name="item_on_unmap_notify__24term_2c__24event">on_unmap_notify $term, $event</a></strong>
843
<p>Called whenever the corresponding X event is received for the terminal If
844
the hook returns true, then the even will be ignored by rxvt-unicode.</p>
788
847
<p>The event is a hash with most values as named by Xlib (see the XEvent
797
856
<p>subwindow.</p>
800
<dt><strong><a name="item_on_client_message__24term_2c__24event">on_client_message $term, $event</a></strong><br />
802
<dt><strong><a name="item_on_wm_protocols__24term_2c__24event">on_wm_protocols $term, $event</a></strong><br />
804
<dt><strong><a name="item_on_wm_delete_window__24term_2c__24event">on_wm_delete_window $term, $event</a></strong><br />
859
<dt><strong><a name="item_on_client_message__24term_2c__24event">on_client_message $term, $event</a></strong>
861
<dt><strong><a name="item_on_wm_protocols__24term_2c__24event">on_wm_protocols $term, $event</a></strong>
863
<dt><strong><a name="item_on_wm_delete_window__24term_2c__24event">on_wm_delete_window $term, $event</a></strong>
807
Called when various types of ClientMessage events are received (all with
808
format=32, WM_PROTOCOLS or WM_PROTOCOLS:WM_DELETE_WINDOW).
866
<p>Called when various types of ClientMessage events are received (all with
867
format=32, WM_PROTOCOLS or WM_PROTOCOLS:WM_DELETE_WINDOW).</p>
813
873
<h2><a name="variables_in_the_urxvt_package">Variables in the <code>urxvt</code> Package</a></h2>
815
<dt><strong><a name="item__24urxvt_3a_3alibdir">$urxvt::LIBDIR</a></strong><br />
818
The rxvt-unicode library directory, where, among other things, the perl
819
modules and scripts are stored.
822
<dt><strong><a name="item__24urxvt_3a_3aresclass_2c__24urxvt_3a_3aresclass">$urxvt::RESCLASS, $urxvt::RESCLASS</a></strong><br />
825
The resource class and name rxvt-unicode uses to look up X resources.
828
<dt><strong><a name="item__24urxvt_3a_3arxvtname">$urxvt::RXVTNAME</a></strong><br />
831
The basename of the installed binaries, usually <code>urxvt</code>.
834
<dt><strong><a name="item__24urxvt_3a_3aterm">$urxvt::TERM</a></strong><br />
837
The current terminal. This variable stores the current <code>urxvt::term</code>
838
object, whenever a callback/hook is executing.
841
<dt><strong><a name="item__40urxvt_3a_3aterm_init">@urxvt::TERM_INIT</a></strong><br />
844
All coderefs in this array will be called as methods of the next newly
875
<dt><strong><a name="item__urxvt__libdir">$urxvt::LIBDIR</a></strong>
878
<p>The rxvt-unicode library directory, where, among other things, the perl
879
modules and scripts are stored.</p>
882
<dt><strong><a name="item__urxvt__resclass_">$urxvt::RESCLASS, $urxvt::RESCLASS</a></strong>
885
<p>The resource class and name rxvt-unicode uses to look up X resources.</p>
888
<dt><strong><a name="item__urxvt__rxvtname">$urxvt::RXVTNAME</a></strong>
891
<p>The basename of the installed binaries, usually <code>urxvt</code>.</p>
894
<dt><strong><a name="item__urxvt__term">$urxvt::TERM</a></strong>
897
<p>The current terminal. This variable stores the current <code>urxvt::term</code>
898
object, whenever a callback/hook is executing.</p>
901
<dt><strong><a name="item__urxvt__term_init">@urxvt::TERM_INIT</a></strong>
904
<p>All code references in this array will be called as methods of the next newly
845
905
created <code>urxvt::term</code> object (during the <code>on_init</code> phase). The array
846
gets cleared before the codereferences that were in it are being executed,
847
so coderefs can push themselves onto it again if they so desire.
906
gets cleared before the code references that were in it are being executed,
907
so references can push themselves onto it again if they so desire.</p>
850
<p>This complements to the perl-eval commandline option, but gets executed
910
<p>This complements to the perl-eval command line option, but gets executed
854
<dt><strong><a name="item__40urxvt_3a_3aterm_ext">@urxvt::TERM_EXT</a></strong><br />
914
<dt><strong><a name="item__urxvt__term_ext">@urxvt::TERM_EXT</a></strong>
857
Works similar to <code>@TERM_INIT</code>, but contains perl package/class names, which
917
<p>Works similar to <code>@TERM_INIT</code>, but contains perl package/class names, which
858
918
get registered as normal extensions after calling the hooks in <code>@TERM_INIT</code>
859
but before other extensions. Gets cleared just like <code>@TERM_INIT</code>.
919
but before other extensions. Gets cleared just like <code>@TERM_INIT</code>.</p>
864
925
<h2><a name="functions_in_the_urxvt_package">Functions in the <code>urxvt</code> Package</a></h2>
866
<dt><strong><a name="item_urxvt_3a_3afatal__24errormessage">urxvt::fatal $errormessage</a></strong><br />
927
<dt><strong><a name="item_urxvt_3a_3afatal__24errormessage">urxvt::fatal $errormessage</a></strong>
869
Fatally aborts execution with the given error message. Avoid at all
930
<p>Fatally aborts execution with the given error message. Avoid at all
870
931
costs! The only time this is acceptable is when the terminal process
874
<dt><strong><a name="item_urxvt_3a_3awarn__24string">urxvt::warn $string</a></strong><br />
935
<dt><strong><a name="item_urxvt_3a_3awarn__24string">urxvt::warn $string</a></strong>
877
Calls <code>rxvt_warn</code> with the given string which should not include a
938
<p>Calls <code>rxvt_warn</code> with the given string which should not include a
878
939
newline. The module also overwrites the <code>warn</code> builtin with a function
879
that calls this function.
940
that calls this function.</p>
882
943
<p>Using this function has the advantage that its output ends up in the
886
947
<p>Messages have a size limit of 1023 bytes currently.</p>
889
<dt><strong><a name="item__40terms__3d_urxvt_3a_3atermlist">@terms = urxvt::termlist</a></strong><br />
950
<dt><strong><a name="item__terms">@terms = urxvt::termlist</a></strong>
892
Returns all urxvt::term objects that exist in this process, regardless of
893
wether they are started, being destroyed etc., so be careful. Only term
953
<p>Returns all urxvt::term objects that exist in this process, regardless of
954
whether they are started, being destroyed etc., so be careful. Only term
894
955
objects that have perl extensions attached will be returned (because there
895
is no urxvt::term objet associated with others).
956
is no urxvt::term objet associated with others).</p>
898
<dt><strong><a name="item__24time__3d_urxvt_3a_3anow">$time = urxvt::NOW</a></strong><br />
959
<dt><strong><a name="item__time">$time = urxvt::NOW</a></strong>
901
Returns the ``current time'' (as per the event loop).
962
<p>Returns the ``current time'' (as per the event loop).</p>
904
<dt><strong><a name="item_urxvt_3a_3acurrenttime">urxvt::CurrentTime</a></strong><br />
965
<dt><strong><a name="item_urxvt_3a_3acurrenttime">urxvt::CurrentTime</a></strong>
906
967
<dt><strong><a name="item_urxvt_3a_3ashiftmask_2c_lockmask_2c_controlmask_2c">urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask,
907
968
Mod3Mask, Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask,
908
Button4Mask, Button5Mask, AnyModifier</a></strong><br />
969
Button4Mask, Button5Mask, AnyModifier</a></strong>
910
971
<dt><strong><a name="item_urxvt_3a_3anoeventmask_2c_keypressmask_2c_keyrelea">urxvt::NoEventMask, KeyPressMask, KeyReleaseMask,
911
972
ButtonPressMask, ButtonReleaseMask, EnterWindowMask, LeaveWindowMask,
912
973
PointerMotionMask, PointerMotionHintMask, Button1MotionMask, Button2MotionMask,
913
974
Button3MotionMask, Button4MotionMask, Button5MotionMask, ButtonMotionMask,
914
975
KeymapStateMask, ExposureMask, VisibilityChangeMask, StructureNotifyMask,
915
976
ResizeRedirectMask, SubstructureNotifyMask, SubstructureRedirectMask,
916
FocusChangeMask, PropertyChangeMask, ColormapChangeMask, OwnerGrabButtonMask</a></strong><br />
977
FocusChangeMask, PropertyChangeMask, ColormapChangeMask, OwnerGrabButtonMask</a></strong>
918
979
<dt><strong><a name="item_urxvt_3a_3akeypress_2c_keyrelease_2c_buttonpress_2">urxvt::KeyPress, KeyRelease, ButtonPress, ButtonRelease, MotionNotify,
919
980
EnterNotify, LeaveNotify, FocusIn, FocusOut, KeymapNotify, Expose,
920
981
GraphicsExpose, NoExpose, VisibilityNotify, CreateNotify, DestroyNotify,
921
982
UnmapNotify, MapNotify, MapRequest, ReparentNotify, ConfigureNotify,
922
983
ConfigureRequest, GravityNotify, ResizeRequest, CirculateNotify,
923
984
CirculateRequest, PropertyNotify, SelectionClear, SelectionRequest,
924
SelectionNotify, ColormapNotify, ClientMessage, MappingNotify</a></strong><br />
985
SelectionNotify, ColormapNotify, ClientMessage, MappingNotify</a></strong>
927
Various constants for use in X calls and event processing.
988
<p>Various constants for use in X calls and event processing.</p>
932
994
<h2><a name="rendition">RENDITION</a></h2>
937
999
as they contain important information required for correct operation of
938
1000
rxvt-unicode.</p>
940
<dt><strong><a name="item__24rend__3d_urxvt_3a_3adefault_rstyle">$rend = urxvt::DEFAULT_RSTYLE</a></strong><br />
943
Returns the default rendition, as used when the terminal is starting up or
944
being reset. Useful as a base to start when creating renditions.
947
<dt><strong><a name="item__24rend__3d_urxvt_3a_3aoverlay_rstyle">$rend = urxvt::OVERLAY_RSTYLE</a></strong><br />
950
Return the rendition mask used for overlays by default.
953
<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 />
956
Return the bit that enabled bold, italic, blink, reverse-video and
1002
<dt><strong><a name="item__rend">$rend = urxvt::DEFAULT_RSTYLE</a></strong>
1005
<p>Returns the default rendition, as used when the terminal is starting up or
1006
being reset. Useful as a base to start when creating renditions.</p>
1009
<dt><strong>$rend = urxvt::OVERLAY_RSTYLE</strong>
1012
<p>Return the rendition mask used for overlays by default.</p>
1015
<dt><strong><a name="item__rendbit">$rendbit = urxvt::RS_Bold, RS_Italic, RS_Blink, RS_RVid, RS_Uline</a></strong>
1018
<p>Return the bit that enabled bold, italic, blink, reverse-video and
957
1019
underline, respectively. To enable such a style, just logically OR it into
961
<dt><strong><a name="item__24foreground__3d_urxvt_3a_3aget_basefg__24rend">$foreground = urxvt::GET_BASEFG $rend</a></strong><br />
963
<dt><strong><a name="item__24background__3d_urxvt_3a_3aget_basebg__24rend">$background = urxvt::GET_BASEBG $rend</a></strong><br />
966
Return the foreground/background colour index, respectively.
969
<dt><strong><a name="item__24rend__3d_urxvt_3a_3aset_fgcolor__24rend_2c__24n">$rend = urxvt::SET_FGCOLOR $rend, $new_colour</a></strong><br />
971
<dt><strong><a name="item__24rend__3d_urxvt_3a_3aset_bgcolor__24rend_2c__24n">$rend = urxvt::SET_BGCOLOR $rend, $new_colour</a></strong><br />
973
<dt><strong><a name="item__24rend__3d_urxvt_3a_3aset_color__24rend_2c__24new">$rend = urxvt::SET_COLOR $rend, $new_fg, $new_bg</a></strong><br />
976
Replace the foreground/background colour in the rendition mask with the
980
<dt><strong><a name="item__24value__3d_urxvt_3a_3aget_custom__24rend">$value = urxvt::GET_CUSTOM $rend</a></strong><br />
983
Return the ``custom'' value: Every rendition has 5 bits for use by
1023
<dt><strong><a name="item__foreground">$foreground = urxvt::GET_BASEFG $rend</a></strong>
1025
<dt><strong><a name="item__background">$background = urxvt::GET_BASEBG $rend</a></strong>
1028
<p>Return the foreground/background colour index, respectively.</p>
1031
<dt><strong>$rend = urxvt::SET_FGCOLOR $rend, $new_colour</strong>
1033
<dt><strong>$rend = urxvt::SET_BGCOLOR $rend, $new_colour</strong>
1035
<dt><strong>$rend = urxvt::SET_COLOR $rend, $new_fg, $new_bg</strong>
1038
<p>Replace the foreground/background colour in the rendition mask with the
1042
<dt><strong><a name="item__value">$value = urxvt::GET_CUSTOM $rend</a></strong>
1045
<p>Return the ``custom'' value: Every rendition has 5 bits for use by
984
1046
extensions. They can be set and changed as you like and are initially
988
<dt><strong><a name="item__24rend__3d_urxvt_3a_3aset_custom__24rend_2c__24ne">$rend = urxvt::SET_CUSTOM $rend, $new_value</a></strong><br />
1050
<dt><strong>$rend = urxvt::SET_CUSTOM $rend, $new_value</strong>
991
Change the custom value.
1053
<p>Change the custom value.</p>
996
1059
<h2><a name="the_urxvt__anyevent_class">The <code>urxvt::anyevent</code> Class</a></h2>
1102
1165
transient_for transparent transparent_all tripleclickwords utmpInhibit
1103
1166
visualBell</pre>
1106
<dt><strong><a name="item_x_resource">$value = $term->x_resource ($pattern)</a></strong><br />
1169
<dt><strong><a name="item_x_resource">$value = $term->x_resource ($pattern)</a></strong>
1109
Returns the X-Resource for the given pattern, excluding the program or
1172
<p>Returns the X-Resource for the given pattern, excluding the program or
1110
1173
class name, i.e. <a href="#item_x_resource"><code>$term->x_resource ("boldFont")</code></a> should return the
1111
1174
same value as used by this instance of rxvt-unicode. Returns <code>undef</code> if no
1112
resource with that pattern exists.
1175
resource with that pattern exists.</p>
1115
1178
<p>This method should only be called during the <code>on_start</code> hook, as there is
1116
1179
only one resource database per display, and later invocations might return
1117
1180
the wrong resources.</p>
1120
<dt><strong><a name="item_parse_keysym">$success = $term->parse_keysym ($keysym_spec, $command_string)</a></strong><br />
1123
Adds a keymap translation exactly as specified via a resource. See the
1124
<code>keysym</code> resource in the <code>rxvt(1)</code> manpage.
1127
<dt><strong><a name="item_rstyle">$rend = $term->rstyle ([$new_rstyle])</a></strong><br />
1130
Return and optionally change the current rendition. Text that is output by
1131
the terminal application will use this style.
1134
<dt><strong><a name="item_screen_cur">($row, $col) = $term->screen_cur ([$row, $col])</a></strong><br />
1137
Return the current coordinates of the text cursor position and optionally
1138
set it (which is usually bad as applications don't expect that).
1141
<dt><strong><a name="item_selection_mark">($row, $col) = $term->selection_mark ([$row, $col])</a></strong><br />
1143
<dt><strong><a name="item_selection_beg">($row, $col) = $term->selection_beg ([$row, $col])</a></strong><br />
1145
<dt><strong><a name="item_selection_end">($row, $col) = $term->selection_end ([$row, $col])</a></strong><br />
1148
Return the current values of the selection mark, begin or end positions,
1149
and optionally set them to new values.
1152
<dt><strong><a name="item_selection_make">$term->selection_make ($eventtime[, $rectangular])</a></strong><br />
1155
Tries to make a selection as set by <a href="#item_selection_beg"><code>selection_beg</code></a> and
1183
<dt><strong><a name="item_parse_keysym">$success = $term->parse_keysym ($keysym_spec, $command_string)</a></strong>
1186
<p>Adds a keymap translation exactly as specified via a resource. See the
1187
<code>keysym</code> resource in the <code>rxvt(1)</code> manpage.</p>
1190
<dt><strong><a name="item_rstyle">$rend = $term->rstyle ([$new_rstyle])</a></strong>
1193
<p>Return and optionally change the current rendition. Text that is output by
1194
the terminal application will use this style.</p>
1197
<dt><strong><a name="item_screen_cur">($row, $col) = $term->screen_cur ([$row, $col])</a></strong>
1200
<p>Return the current coordinates of the text cursor position and optionally
1201
set it (which is usually bad as applications don't expect that).</p>
1204
<dt><strong><a name="item_selection_mark">($row, $col) = $term->selection_mark ([$row, $col])</a></strong>
1206
<dt><strong><a name="item_selection_beg">($row, $col) = $term->selection_beg ([$row, $col])</a></strong>
1208
<dt><strong><a name="item_selection_end">($row, $col) = $term->selection_end ([$row, $col])</a></strong>
1211
<p>Return the current values of the selection mark, begin or end positions,
1212
and optionally set them to new values.</p>
1215
<dt><strong><a name="item_selection_make">$term->selection_make ($eventtime[, $rectangular])</a></strong>
1218
<p>Tries to make a selection as set by <a href="#item_selection_beg"><code>selection_beg</code></a> and
1156
1219
<a href="#item_selection_end"><code>selection_end</code></a>. If <code>$rectangular</code> is true (default: false), a
1157
1220
rectangular selection will be made. This is the prefered function to make
1161
<dt><strong><a name="item_selection_grab">$success = $term->selection_grab ($eventtime)</a></strong><br />
1224
<dt><strong><a name="item_selection_grab">$success = $term->selection_grab ($eventtime)</a></strong>
1164
Try to request the primary selection text from the server (for example, as
1227
<p>Try to request the primary selection text from the server (for example, as
1165
1228
set by the next method). No visual feedback will be given. This function
1166
is mostly useful from within <code>on_sel_grab</code> hooks.
1169
<dt><strong>$oldtext = $term->selection ([$newtext])</strong><br />
1172
Return the current selection text and optionally replace it by <code>$newtext</code>.
1175
<dt><strong><a name="item_overlay_simple">$term->overlay_simple ($x, $y, $text)</a></strong><br />
1178
Create a simple multi-line overlay box. See the next method for details.
1181
<dt><strong><a name="item_overlay">$term->overlay ($x, $y, $width, $height[, $rstyle[, $border]])</a></strong><br />
1184
Create a new (empty) overlay at the given position with the given
1229
is mostly useful from within <code>on_sel_grab</code> hooks.</p>
1232
<dt><strong>$oldtext = $term->selection ([$newtext])</strong>
1235
<p>Return the current selection text and optionally replace it by <code>$newtext</code>.</p>
1238
<dt><strong><a name="item_overlay_simple">$term->overlay_simple ($x, $y, $text)</a></strong>
1241
<p>Create a simple multi-line overlay box. See the next method for details.</p>
1244
<dt><strong><a name="item_overlay">$term->overlay ($x, $y, $width, $height[, $rstyle[, $border]])</a></strong>
1247
<p>Create a new (empty) overlay at the given position with the given
1185
1248
width/height. <code>$rstyle</code> defines the initial rendition style
1186
(default: <code>OVERLAY_RSTYLE</code>).
1249
(default: <code>OVERLAY_RSTYLE</code>).</p>
1189
1252
<p>If <code>$border</code> is <code>2</code> (default), then a decorative border will be put
1201
1264
<p>The methods currently supported on <code>urxvt::overlay</code> objects are:</p>
1204
<dt><strong><a name="item_set">$overlay->set ($x, $y, $text, $rend)</a></strong><br />
1267
<dt><strong><a name="item_set">$overlay->set ($x, $y, $text, $rend)</a></strong>
1207
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
1270
<p>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
1208
1271
text in rxvt-unicode's special encoding and an array of rendition values
1209
at a specific position inside the overlay.
1212
<dt><strong><a name="item_hide">$overlay->hide</a></strong><br />
1215
If visible, hide the overlay, but do not destroy it.
1218
<dt><strong><a name="item_show">$overlay->show</a></strong><br />
1221
If hidden, display the overlay again.
1224
<dt><strong>$popup = $term->popup ($event)</strong><br />
1227
Creates a new <code>urxvt::popup</code> object that implements a popup menu. The
1272
at a specific position inside the overlay.</p>
1275
<dt><strong><a name="item_hide">$overlay->hide</a></strong>
1278
<p>If visible, hide the overlay, but do not destroy it.</p>
1281
<dt><strong><a name="item_show">$overlay->show</a></strong>
1284
<p>If hidden, display the overlay again.</p>
1288
<dt><strong>$popup = $term->popup ($event)</strong>
1291
<p>Creates a new <code>urxvt::popup</code> object that implements a popup menu. The
1228
1292
<code>$event</code> <em>must</em> be the event causing the menu to pop up (a button event,
1232
<dt><strong><a name="item_strwidth">$cellwidth = $term->strwidth ($string)</a></strong><br />
1235
Returns the number of screen-cells this string would need. Correctly
1236
accounts for wide and combining characters.
1239
<dt><strong><a name="item_locale_encode">$octets = $term->locale_encode ($string)</a></strong><br />
1242
Convert the given text string into the corresponding locale encoding.
1245
<dt><strong><a name="item_locale_decode">$string = $term->locale_decode ($octets)</a></strong><br />
1248
Convert the given locale-encoded octets into a perl string.
1251
<dt><strong><a name="item_scr_xor_span">$term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle])</a></strong><br />
1254
XORs the rendition values in the given span with the provided value
1296
<dt><strong><a name="item_strwidth">$cellwidth = $term->strwidth ($string)</a></strong>
1299
<p>Returns the number of screen-cells this string would need. Correctly
1300
accounts for wide and combining characters.</p>
1303
<dt><strong><a name="item_locale_encode">$octets = $term->locale_encode ($string)</a></strong>
1306
<p>Convert the given text string into the corresponding locale encoding.</p>
1309
<dt><strong><a name="item_locale_decode">$string = $term->locale_decode ($octets)</a></strong>
1312
<p>Convert the given locale-encoded octets into a perl string.</p>
1315
<dt><strong><a name="item_scr_xor_span">$term->scr_xor_span ($beg_row, $beg_col, $end_row, $end_col[, $rstyle])</a></strong>
1318
<p>XORs the rendition values in the given span with the provided value
1255
1319
(default: <code>RS_RVid</code>), which <em>MUST NOT</em> contain font styles. Useful in
1256
refresh hooks to provide effects similar to the selection.
1320
refresh hooks to provide effects similar to the selection.</p>
1259
<dt><strong><a name="item_scr_xor_rect">$term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, $rstyle2]])</a></strong><br />
1323
<dt><strong><a name="item_scr_xor_rect">$term->scr_xor_rect ($beg_row, $beg_col, $end_row, $end_col[, $rstyle1[, $rstyle2]])</a></strong>
1262
Similar to <a href="#item_scr_xor_span"><code>scr_xor_span</code></a>, but xors a rectangle instead. Trailing
1326
<p>Similar to <a href="#item_scr_xor_span"><code>scr_xor_span</code></a>, but xors a rectangle instead. Trailing
1263
1327
whitespace will additionally be xored with the <code>$rstyle2</code>, which defaults
1264
1328
to <code>RS_RVid | RS_Uline</code>, which removes reverse video again and underlines
1265
it instead. Both styles <em>MUST NOT</em> contain font styles.
1268
<dt><strong><a name="item_scr_bell">$term->scr_bell</a></strong><br />
1274
<dt><strong><a name="item_scr_add_lines">$term->scr_add_lines ($string)</a></strong><br />
1277
Write the given text string to the screen, as if output by the application
1329
it instead. Both styles <em>MUST NOT</em> contain font styles.</p>
1332
<dt><strong><a name="item_scr_bell">$term->scr_bell</a></strong>
1335
<p>Ring the bell!</p>
1338
<dt><strong><a name="item_scr_add_lines">$term->scr_add_lines ($string)</a></strong>
1341
<p>Write the given text string to the screen, as if output by the application
1278
1342
running inside the terminal. It may not contain command sequences (escape
1279
1343
codes), but is free to use line feeds, carriage returns and tabs. The
1280
string is a normal text string, not in locale-dependent encoding.
1344
string is a normal text string, not in locale-dependent encoding.</p>
1283
1347
<p>Normally its not a good idea to use this function, as programs might be
1284
1348
confused by changes in cursor position or scrolling. Its useful inside a
1285
1349
<code>on_add_lines</code> hook, though.</p>
1288
<dt><strong><a name="item_scr_change_screen">$term->scr_change_screen ($screen)</a></strong><br />
1352
<dt><strong><a name="item_scr_change_screen">$term->scr_change_screen ($screen)</a></strong>
1291
Switch to given screen - 0 primary, 1 secondary.
1355
<p>Switch to given screen - 0 primary, 1 secondary.</p>
1294
<dt><strong><a name="item_cmd_parse">$term->cmd_parse ($octets)</a></strong><br />
1358
<dt><strong><a name="item_cmd_parse">$term->cmd_parse ($octets)</a></strong>
1297
Similar to <a href="#item_scr_add_lines"><code>scr_add_lines</code></a>, but the argument must be in the
1361
<p>Similar to <a href="#item_scr_add_lines"><code>scr_add_lines</code></a>, but the argument must be in the
1298
1362
locale-specific encoding of the terminal and can contain command sequences
1299
(escape codes) that will be interpreted.
1363
(escape codes) that will be interpreted.</p>
1302
<dt><strong><a name="item_tt_write">$term->tt_write ($octets)</a></strong><br />
1366
<dt><strong><a name="item_tt_write">$term->tt_write ($octets)</a></strong>
1305
Write the octets given in <code>$data</code> to the tty (i.e. as program input). To
1369
<p>Write the octets given in <code>$data</code> to the tty (i.e. as program input). To
1306
1370
pass characters instead of octets, you should convert your strings first
1307
to the locale-specific encoding using <a href="#item_locale_encode"><code>$term->locale_encode</code></a>.
1371
to the locale-specific encoding using <a href="#item_locale_encode"><code>$term->locale_encode</code></a>.</p>
1310
<dt><strong><a name="item_pty_ev_events">$old_events = $term->pty_ev_events ([$new_events])</a></strong><br />
1374
<dt><strong><a name="item_pty_ev_events">$old_events = $term->pty_ev_events ([$new_events])</a></strong>
1313
Replaces the event mask of the pty watcher by the given event mask. Can
1377
<p>Replaces the event mask of the pty watcher by the given event mask. Can
1314
1378
be used to suppress input and output handling to the pty/tty. See the
1315
1379
description of <a href="#item_events"><code>urxvt::timer->events</code></a>. Make sure to always restore
1319
<dt><strong><a name="item_pty_fd">$fd = $term->pty_fd</a></strong><br />
1322
Returns the master file descriptor for the pty in use, or <code>-1</code> if no pty
1326
<dt><strong><a name="item_parent">$windowid = $term->parent</a></strong><br />
1329
Return the window id of the toplevel window.
1332
<dt><strong><a name="item_vt">$windowid = $term->vt</a></strong><br />
1335
Return the window id of the terminal window.
1338
<dt><strong><a name="item_vt_emask_add">$term->vt_emask_add ($x_event_mask)</a></strong><br />
1341
Adds the specified events to the vt event mask. Useful e.g. when you want
1342
to receive pointer events all the times:
1380
the previous value.</p>
1383
<dt><strong><a name="item_pty_fd">$fd = $term->pty_fd</a></strong>
1386
<p>Returns the master file descriptor for the pty in use, or <code>-1</code> if no pty
1390
<dt><strong><a name="item_parent">$windowid = $term->parent</a></strong>
1393
<p>Return the window id of the toplevel window.</p>
1396
<dt><strong><a name="item_vt">$windowid = $term->vt</a></strong>
1399
<p>Return the window id of the terminal window.</p>
1402
<dt><strong><a name="item_vt_emask_add">$term->vt_emask_add ($x_event_mask)</a></strong>
1405
<p>Adds the specified events to the vt event mask. Useful e.g. when you want
1406
to receive pointer events all the times:</p>
1346
1410
$term->vt_emask_add (urxvt::PointerMotionMask);</pre>
1349
<dt><strong><a name="item_focus_in">$term->focus_in</a></strong><br />
1351
<dt><strong><a name="item_focus_out">$term->focus_out</a></strong><br />
1353
<dt><strong><a name="item_key_press">$term->key_press ($state, $keycode[, $time])</a></strong><br />
1355
<dt><strong><a name="item_key_release">$term->key_release ($state, $keycode[, $time])</a></strong><br />
1358
Deliver various fake events to to terminal.
1361
<dt><strong><a name="item_width">$window_width = $term->width</a></strong><br />
1363
<dt><strong><a name="item_height">$window_height = $term->height</a></strong><br />
1365
<dt><strong><a name="item_fwidth">$font_width = $term->fwidth</a></strong><br />
1367
<dt><strong><a name="item_fheight">$font_height = $term->fheight</a></strong><br />
1369
<dt><strong><a name="item_fbase">$font_ascent = $term->fbase</a></strong><br />
1371
<dt><strong><a name="item_nrow">$terminal_rows = $term->nrow</a></strong><br />
1373
<dt><strong><a name="item_ncol">$terminal_columns = $term->ncol</a></strong><br />
1375
<dt><strong><a name="item_focus">$has_focus = $term->focus</a></strong><br />
1377
<dt><strong><a name="item_mapped">$is_mapped = $term->mapped</a></strong><br />
1379
<dt><strong><a name="item_savelines">$max_scrollback = $term->saveLines</a></strong><br />
1381
<dt><strong><a name="item_total_rows">$nrow_plus_saveLines = $term->total_rows</a></strong><br />
1383
<dt><strong><a name="item_top_row">$topmost_scrollback_row = $term->top_row</a></strong><br />
1386
Return various integers describing terminal characteristics.
1389
<dt><strong><a name="item_display_id">$x_display = $term->display_id</a></strong><br />
1392
Return the DISPLAY used by rxvt-unicode.
1395
<dt><strong><a name="item_locale">$lc_ctype = $term->locale</a></strong><br />
1398
Returns the LC_CTYPE category string used by this rxvt-unicode.
1401
<dt><strong><a name="item_env">$env = $term->env</a></strong><br />
1404
Returns a copy of the environment in effect for the terminal as a hashref
1405
similar to <code>\%ENV</code>.
1408
<dt><strong><a name="item_envv">@envv = $term->envv</a></strong><br />
1411
Returns the environment as array of strings of the form <code>VAR=VALUE</code>.
1414
<dt><strong><a name="item_argv">@argv = $term->argv</a></strong><br />
1417
Return the argument vector as this terminal, similar to @ARGV, but
1418
includes the program name as first element.
1421
<dt><strong><a name="item_modlevel3mask">$modifiermask = $term->ModLevel3Mask</a></strong><br />
1423
<dt><strong><a name="item_modmetamask">$modifiermask = $term->ModMetaMask</a></strong><br />
1425
<dt><strong><a name="item_modnumlockmask">$modifiermask = $term->ModNumLockMask</a></strong><br />
1428
Return the modifier masks corresponding to the ``ISO Level 3 Shift'' (often
1429
AltGr), the meta key (often Alt) and the num lock key, if applicable.
1432
<dt><strong><a name="item_current_screen">$screen = $term->current_screen</a></strong><br />
1435
Returns the currently displayed screen (0 primary, 1 secondary).
1438
<dt><strong><a name="item_hidden_cursor">$cursor_is_hidden = $term->hidden_cursor</a></strong><br />
1441
Returns wether the cursor is currently hidden or not.
1444
<dt><strong><a name="item_view_start">$view_start = $term->view_start ([$newvalue])</a></strong><br />
1447
Returns the row number of the topmost displayed line. Maximum value is
1413
<dt><strong><a name="item_focus_in">$term->focus_in</a></strong>
1415
<dt><strong><a name="item_focus_out">$term->focus_out</a></strong>
1417
<dt><strong><a name="item_key_press">$term->key_press ($state, $keycode[, $time])</a></strong>
1419
<dt><strong><a name="item_key_release">$term->key_release ($state, $keycode[, $time])</a></strong>
1422
<p>Deliver various fake events to to terminal.</p>
1425
<dt><strong><a name="item_width">$window_width = $term->width</a></strong>
1427
<dt><strong><a name="item_height">$window_height = $term->height</a></strong>
1429
<dt><strong><a name="item_fwidth">$font_width = $term->fwidth</a></strong>
1431
<dt><strong><a name="item_fheight">$font_height = $term->fheight</a></strong>
1433
<dt><strong><a name="item_fbase">$font_ascent = $term->fbase</a></strong>
1435
<dt><strong><a name="item_nrow">$terminal_rows = $term->nrow</a></strong>
1437
<dt><strong><a name="item_ncol">$terminal_columns = $term->ncol</a></strong>
1439
<dt><strong><a name="item_focus">$has_focus = $term->focus</a></strong>
1441
<dt><strong><a name="item_mapped">$is_mapped = $term->mapped</a></strong>
1443
<dt><strong><a name="item_savelines">$max_scrollback = $term->saveLines</a></strong>
1445
<dt><strong><a name="item_total_rows">$nrow_plus_saveLines = $term->total_rows</a></strong>
1447
<dt><strong><a name="item_top_row">$topmost_scrollback_row = $term->top_row</a></strong>
1450
<p>Return various integers describing terminal characteristics.</p>
1453
<dt><strong><a name="item_display_id">$x_display = $term->display_id</a></strong>
1456
<p>Return the DISPLAY used by rxvt-unicode.</p>
1459
<dt><strong><a name="item_locale">$lc_ctype = $term->locale</a></strong>
1462
<p>Returns the LC_CTYPE category string used by this rxvt-unicode.</p>
1465
<dt><strong><a name="item_env">$env = $term->env</a></strong>
1468
<p>Returns a copy of the environment in effect for the terminal as a hashref
1469
similar to <code>\%ENV</code>.</p>
1472
<dt><strong><a name="item_envv">@envv = $term->envv</a></strong>
1475
<p>Returns the environment as array of strings of the form <code>VAR=VALUE</code>.</p>
1478
<dt><strong><a name="item_argv">@argv = $term->argv</a></strong>
1481
<p>Return the argument vector as this terminal, similar to @ARGV, but
1482
includes the program name as first element.</p>
1485
<dt><strong><a name="item_modlevel3mask">$modifiermask = $term->ModLevel3Mask</a></strong>
1487
<dt><strong><a name="item_modmetamask">$modifiermask = $term->ModMetaMask</a></strong>
1489
<dt><strong><a name="item_modnumlockmask">$modifiermask = $term->ModNumLockMask</a></strong>
1492
<p>Return the modifier masks corresponding to the ``ISO Level 3 Shift'' (often
1493
AltGr), the meta key (often Alt) and the num lock key, if applicable.</p>
1496
<dt><strong><a name="item_current_screen">$screen = $term->current_screen</a></strong>
1499
<p>Returns the currently displayed screen (0 primary, 1 secondary).</p>
1502
<dt><strong><a name="item_hidden_cursor">$cursor_is_hidden = $term->hidden_cursor</a></strong>
1505
<p>Returns whether the cursor is currently hidden or not.</p>
1508
<dt><strong><a name="item_view_start">$view_start = $term->view_start ([$newvalue])</a></strong>
1511
<p>Returns the row number of the topmost displayed line. Maximum value is
1448
1512
<code>0</code>, which displays the normal terminal contents. Lower values scroll
1449
this many lines into the scrollback buffer.
1513
this many lines into the scrollback buffer.</p>
1452
<dt><strong><a name="item_want_refresh">$term->want_refresh</a></strong><br />
1516
<dt><strong><a name="item_want_refresh">$term->want_refresh</a></strong>
1455
Requests a screen refresh. At the next opportunity, rxvt-unicode will
1519
<p>Requests a screen refresh. At the next opportunity, rxvt-unicode will
1456
1520
compare the on-screen display with its stored representation. If they
1457
differ, it redraws the differences.
1521
differ, it redraws the differences.</p>
1460
1524
<p>Used after changing terminal contents to display them.</p>
1463
<dt><strong><a name="item_row_t">$text = $term->ROW_t ($row_number[, $new_text[, $start_col]])</a></strong><br />
1527
<dt><strong><a name="item_row_t">$text = $term->ROW_t ($row_number[, $new_text[, $start_col]])</a></strong>
1466
Returns the text of the entire row with number <code>$row_number</code>. Row <code>0</code>
1530
<p>Returns the text of the entire row with number <code>$row_number</code>. Row <code>0</code>
1467
1531
is the topmost terminal line, row <code>$term->$ncol-1</code> is the bottommost
1468
1532
terminal line. The scrollback buffer starts at line <code>-1</code> and extends to
1469
1533
line <code>-$term->nsaved</code>. Nothing will be returned if a nonexistent line
1473
1537
<p>If <code>$new_text</code> is specified, it will replace characters in the current
1506
1570
<p>See the section on RENDITION, above.</p>
1509
<dt><strong><a name="item_row_l">$length = $term->ROW_l ($row_number[, $new_length])</a></strong><br />
1573
<dt><strong><a name="item_row_l">$length = $term->ROW_l ($row_number[, $new_length])</a></strong>
1512
Returns the number of screen cells that are in use (``the line
1576
<p>Returns the number of screen cells that are in use (``the line
1513
1577
length''). Unlike the urxvt core, this returns <a href="#item_ncol"><code>$term->ncol</code></a> if the
1514
line is joined with the following one.
1578
line is joined with the following one.</p>
1517
<dt><strong><a name="item_is_longer">$bool = $term->is_longer ($row_number)</a></strong><br />
1581
<dt><strong><a name="item_is_longer">$bool = $term->is_longer ($row_number)</a></strong>
1520
Returns true if the row is part of a multiple-row logical ``line'' (i.e.
1584
<p>Returns true if the row is part of a multiple-row logical ``line'' (i.e.
1521
1585
joined with the following row), which means all characters are in use
1522
1586
and it is continued on the next row (and possibly a continuation of the
1587
previous row(s)).</p>
1526
<dt><strong><a name="item_line">$line = $term->line ($row_number)</a></strong><br />
1590
<dt><strong><a name="item_line">$line = $term->line ($row_number)</a></strong>
1529
Create and return a new <code>urxvt::line</code> object that stores information
1593
<p>Create and return a new <code>urxvt::line</code> object that stores information
1530
1594
about the logical line that row <code>$row_number</code> is part of. It supports the
1595
following methods:</p>
1534
<dt><strong><a name="item_t">$text = $line->t ([$new_text])</a></strong><br />
1537
Returns or replaces the full text of the line, similar to <a href="#item_row_t"><code>ROW_t</code></a>
1540
<dt><strong><a name="item_r">$rend = $line->r ([$new_rend])</a></strong><br />
1543
Returns or replaces the full rendition array of the line, similar to <a href="#item_row_r"><code>ROW_r</code></a>
1546
<dt><strong><a name="item_l">$length = $line->l</a></strong><br />
1549
Returns the length of the line in cells, similar to <a href="#item_row_l"><code>ROW_l</code></a>.
1552
<dt><strong><a name="item_beg">$rownum = $line->beg</a></strong><br />
1554
<dt><strong><a name="item_end">$rownum = $line->end</a></strong><br />
1557
Return the row number of the first/last row of the line, respectively.
1560
<dt><strong><a name="item_offset_of">$offset = $line->offset_of ($row, $col)</a></strong><br />
1563
Returns the character offset of the given row|col pair within the logical
1598
<dt><strong><a name="item_t">$text = $line->t ([$new_text])</a></strong>
1601
<p>Returns or replaces the full text of the line, similar to <a href="#item_row_t"><code>ROW_t</code></a></p>
1604
<dt><strong><a name="item_r">$rend = $line->r ([$new_rend])</a></strong>
1607
<p>Returns or replaces the full rendition array of the line, similar to <a href="#item_row_r"><code>ROW_r</code></a></p>
1610
<dt><strong><a name="item_l">$length = $line->l</a></strong>
1613
<p>Returns the length of the line in cells, similar to <a href="#item_row_l"><code>ROW_l</code></a>.</p>
1616
<dt><strong><a name="item_beg">$rownum = $line->beg</a></strong>
1618
<dt><strong><a name="item_end">$rownum = $line->end</a></strong>
1621
<p>Return the row number of the first/last row of the line, respectively.</p>
1624
<dt><strong><a name="item_offset_of">$offset = $line->offset_of ($row, $col)</a></strong>
1627
<p>Returns the character offset of the given row|col pair within the logical
1564
1628
line. Works for rows outside the line, too, and returns corresponding
1565
offsets outside the string.
1568
<dt><strong><a name="item_coord_of">($row, $col) = $line->coord_of ($offset)</a></strong><br />
1571
Translates a string offset into terminal coordinates again.
1574
<dt><strong><a name="item_special_encode">$text = $term->special_encode $string</a></strong><br />
1577
Converts a perl string into the special encoding used by rxvt-unicode,
1629
offsets outside the string.</p>
1632
<dt><strong><a name="item_coord_of">($row, $col) = $line->coord_of ($offset)</a></strong>
1635
<p>Translates a string offset into terminal coordinates again.</p>
1639
<dt><strong><a name="item_special_encode">$text = $term->special_encode $string</a></strong>
1642
<p>Converts a perl string into the special encoding used by rxvt-unicode,
1578
1643
where one character corresponds to one screen cell. See
1579
<a href="#item_row_t"><code>$term->ROW_t</code></a> for details.
1582
<dt><strong><a name="item_special_decode">$string = $term->special_decode $text</a></strong><br />
1585
Converts rxvt-unicodes text reprsentation into a perl string. See
1586
<a href="#item_row_t"><code>$term->ROW_t</code></a> for details.
1589
<dt><strong><a name="item_grab_button">$success = $term->grab_button ($button, $modifiermask[, $window = $term->vt])</a></strong><br />
1591
<dt><strong><a name="item_ungrab_button">$term->ungrab_button ($button, $modifiermask[, $window = $term->vt])</a></strong><br />
1594
Register/unregister a synchronous button grab. See the XGrabButton
1598
<dt><strong><a name="item_grab">$success = $term->grab ($eventtime[, $sync])</a></strong><br />
1601
Calls XGrabPointer and XGrabKeyboard in asynchronous (default) or
1602
synchronous (<code>$sync</code> is true). Also remembers the grab timestampe.
1605
<dt><strong><a name="item_allow_events_async">$term->allow_events_async</a></strong><br />
1608
Calls XAllowEvents with AsyncBoth for the most recent grab.
1611
<dt><strong><a name="item_allow_events_sync">$term->allow_events_sync</a></strong><br />
1614
Calls XAllowEvents with SyncBoth for the most recent grab.
1617
<dt><strong><a name="item_allow_events_replay">$term->allow_events_replay</a></strong><br />
1620
Calls XAllowEvents with both ReplayPointer and ReplayKeyboard for the most
1624
<dt><strong><a name="item_ungrab">$term->ungrab</a></strong><br />
1627
Calls XUngrab for the most recent grab. Is called automatically on
1644
<a href="#item_row_t"><code>$term->ROW_t</code></a> for details.</p>
1647
<dt><strong><a name="item_special_decode">$string = $term->special_decode $text</a></strong>
1650
<p>Converts rxvt-unicodes text representation into a perl string. See
1651
<a href="#item_row_t"><code>$term->ROW_t</code></a> for details.</p>
1654
<dt><strong><a name="item_grab_button">$success = $term->grab_button ($button, $modifiermask[, $window = $term->vt])</a></strong>
1656
<dt><strong><a name="item_ungrab_button">$term->ungrab_button ($button, $modifiermask[, $window = $term->vt])</a></strong>
1659
<p>Register/unregister a synchronous button grab. See the XGrabButton
1663
<dt><strong><a name="item_grab">$success = $term->grab ($eventtime[, $sync])</a></strong>
1666
<p>Calls XGrabPointer and XGrabKeyboard in asynchronous (default) or
1667
synchronous (<code>$sync</code> is true). Also remembers the grab timestamp.</p>
1670
<dt><strong><a name="item_allow_events_async">$term->allow_events_async</a></strong>
1673
<p>Calls XAllowEvents with AsyncBoth for the most recent grab.</p>
1676
<dt><strong><a name="item_allow_events_sync">$term->allow_events_sync</a></strong>
1679
<p>Calls XAllowEvents with SyncBoth for the most recent grab.</p>
1682
<dt><strong><a name="item_allow_events_replay">$term->allow_events_replay</a></strong>
1685
<p>Calls XAllowEvents with both ReplayPointer and ReplayKeyboard for the most
1689
<dt><strong><a name="item_ungrab">$term->ungrab</a></strong>
1692
<p>Calls XUngrab for the most recent grab. Is called automatically on
1628
1693
evaluation errors, as it is better to lose the grab in the error case as
1632
<dt><strong><a name="item_xinternatom">$atom = $term->XInternAtom ($atom_name[, $only_if_exists])</a></strong><br />
1634
<dt><strong><a name="item_xgetatomname">$atom_name = $term->XGetAtomName ($atom)</a></strong><br />
1636
<dt><strong><a name="item_xlistproperties">@atoms = $term->XListProperties ($window)</a></strong><br />
1638
<dt><strong><a name="item_xgetwindowproperty">($type,$format,$octets) = $term->XGetWindowProperty ($window, $property)</a></strong><br />
1640
<dt><strong><a name="item_xchangewindowproperty">$term->XChangeWindowProperty ($window, $property, $type, $format, $octets)</a></strong><br />
1642
<dt><strong><a name="item_xdeleteproperty">$term->XDeleteProperty ($window, $property)</a></strong><br />
1644
<dt><strong><a name="item_defaultrootwindow">$window = $term->DefaultRootWindow</a></strong><br />
1646
<dt><strong><a name="item_xreparentwindow">$term->XReparentWindow ($window, $parent, [$x, $y])</a></strong><br />
1648
<dt><strong><a name="item_xmapwindow">$term->XMapWindow ($window)</a></strong><br />
1650
<dt><strong><a name="item_xunmapwindow">$term->XUnmapWindow ($window)</a></strong><br />
1652
<dt><strong><a name="item_xmoveresizewindow">$term->XMoveResizeWindow ($window, $x, $y, $width, $height)</a></strong><br />
1654
<dt><strong><a name="item_xtranslatecoordinates">($x, $y, $child_window) = $term->XTranslateCoordinates ($src, $dst, $x, $y)</a></strong><br />
1656
<dt><strong><a name="item_xchangeinput">$term->XChangeInput ($window, $add_events[, $del_events])</a></strong><br />
1697
<dt><strong><a name="item_xinternatom">$atom = $term->XInternAtom ($atom_name[, $only_if_exists])</a></strong>
1699
<dt><strong><a name="item_xgetatomname">$atom_name = $term->XGetAtomName ($atom)</a></strong>
1701
<dt><strong><a name="item_xlistproperties">@atoms = $term->XListProperties ($window)</a></strong>
1703
<dt><strong><a name="item_xgetwindowproperty">($type,$format,$octets) = $term->XGetWindowProperty ($window, $property)</a></strong>
1705
<dt><strong><a name="item_xchangewindowproperty">$term->XChangeWindowProperty ($window, $property, $type, $format, $octets)</a></strong>
1707
<dt><strong><a name="item_xdeleteproperty">$term->XDeleteProperty ($window, $property)</a></strong>
1709
<dt><strong><a name="item_defaultrootwindow">$window = $term->DefaultRootWindow</a></strong>
1711
<dt><strong><a name="item_xreparentwindow">$term->XReparentWindow ($window, $parent, [$x, $y])</a></strong>
1713
<dt><strong><a name="item_xmapwindow">$term->XMapWindow ($window)</a></strong>
1715
<dt><strong><a name="item_xunmapwindow">$term->XUnmapWindow ($window)</a></strong>
1717
<dt><strong><a name="item_xmoveresizewindow">$term->XMoveResizeWindow ($window, $x, $y, $width, $height)</a></strong>
1719
<dt><strong><a name="item_xtranslatecoordinates">($x, $y, $child_window) = $term->XTranslateCoordinates ($src, $dst, $x, $y)</a></strong>
1721
<dt><strong><a name="item_xchangeinput">$term->XChangeInput ($window, $add_events[, $del_events])</a></strong>
1659
Various X or X-related functions. The <code>$term</code> object only serves as
1724
<p>Various X or X-related functions. The <a href="#item__term"><code>$term</code></a> object only serves as
1660
1725
the source of the display, otherwise those functions map more-or-less
1661
directory onto the X functions of the same name.
1726
directory onto the X functions of the same name.</p>
1666
1732
<h2><a name="the_urxvt__popup_class">The <code>urxvt::popup</code> Class</a></h2>
1668
<dt><strong><a name="item_add_title">$popup->add_title ($title)</a></strong><br />
1671
Adds a non-clickable title to the popup.
1674
<dt><strong><a name="item_add_separator">$popup->add_separator ([$sepchr])</a></strong><br />
1677
Creates a separator, optionally using the character given as <code>$sepchr</code>.
1680
<dt><strong><a name="item_add_button">$popup->add_button ($text, $cb)</a></strong><br />
1683
Adds a clickable button to the popup. <code>$cb</code> is called whenever it is
1687
<dt><strong><a name="item_add_toggle">$popup->add_toggle ($text, $initial_value, $cb)</a></strong><br />
1690
Adds a toggle/checkbox item to the popup. The callback gets called
1734
<dt><strong><a name="item_add_title">$popup->add_title ($title)</a></strong>
1737
<p>Adds a non-clickable title to the popup.</p>
1740
<dt><strong><a name="item_add_separator">$popup->add_separator ([$sepchr])</a></strong>
1743
<p>Creates a separator, optionally using the character given as <code>$sepchr</code>.</p>
1746
<dt><strong><a name="item_add_button">$popup->add_button ($text, $cb)</a></strong>
1749
<p>Adds a clickable button to the popup. <code>$cb</code> is called whenever it is
1753
<dt><strong><a name="item_add_toggle">$popup->add_toggle ($text, $initial_value, $cb)</a></strong>
1756
<p>Adds a toggle/checkbox item to the popup. The callback gets called
1691
1757
whenever it gets toggled, with a boolean indicating its new value as its
1695
<dt><strong>$popup->show</strong><br />
1761
<dt><strong>$popup->show</strong>
1698
Displays the popup (which is initially hidden).
1764
<p>Displays the popup (which is initially hidden).</p>
1703
1770
<h2><a name="the_urxvt__timer_class">The <code>urxvt::timer</code> Class</a></h2>