--- rxvt-unicode/doc/rxvtperl.3.txt 2006/01/19 19:26:31 1.31 +++ rxvt-unicode/doc/rxvtperl.3.txt 2006/01/21 19:50:53 1.34 @@ -31,6 +31,10 @@ rxvt -pe + Or by adding them to the resource for extensions loaded by default: + + URxvt.perl-ext-common: default,automove-background,selection-autotransform + selection (enabled by default) (More) intelligent selection. This extension tries to be more intelligent when the user extends selections (double-click and @@ -73,8 +77,8 @@ selection-popup (enabled by default) Binds a popup menu to Ctrl-Button3 that lets you convert the selection text into various other formats/action (such as uri - unescaping, perl evalution, web-browser starting etc.), depending on - content. + unescaping, perl evaluation, web-browser starting etc.), depending + on content. Other extensions can extend this popup menu by pushing a code reference onto "@{ $term-"{selection_popup_hook} }>, that is called @@ -110,6 +114,23 @@ stay at the current position and additionally stores the first match in the current line into the primary selection. + readline (enabled by default) + A support package that tries to make editing with readline easier. + At the moment, it reacts to clicking with the left mouse button by + trying to move the text cursor to this position. It does so by + generating as many cursor-left or cursor-right keypresses as + required (the this only works for programs that correctly support + wide characters). + + To avoid too many false positives, this is only done when: + + - the mouse is on the same (multi-row-) line as the text cursor. + - the primary screen is currently being displayed. + - the text cursor is visible. + + The normal selection mechanism isn't disabled, so quick successive + clicks might interfere with selection creation in harmless ways. + selection-autotransform This selection allows you to do automatic transforms on a selection whenever a selection is made. @@ -145,6 +166,17 @@ of every error message as a selection pattern, and the second line transforms the message into vi commands to load the file. + tabbed + This transforms the terminal into a tabbar with additional + terminals, that is, it implements what is commonly refered to as + "tabbed terminal". The topmost line displays a "[NEW]" button, + which, when clicked, will add a new tab, followed by one button per + tab. + + Clicking a button will activate that tab. Pressing Shift-Left and + Shift-Right will switch to the tab left or right of the current one, + while Shift-Down creates a new tab. + mark-urls Uses per-line display filtering ("on_line_update") to underline urls and make them clickable. When middle-clicked, the program specified @@ -262,10 +294,9 @@ The first argument passed to them is an extension oject as described in the in the "Extension Objects" section. - All of these hooks must return a boolean value. If it is true, then the - event counts as being *consumed*, and the invocation of other hooks is - skipped, and the relevant action might not be carried out by the C++ - code. + All of these hooks must return a boolean value. If any of the called + hooks returns true, then the event counts as being *consumed*, and the + relevant action might not be carried out by the C++ code. *When in doubt, return a false value (preferably "()").* @@ -274,17 +305,24 @@ windows are created or the command gets run. Most methods are unsafe to call or deliver senseless data, as terminal size and other characteristics have not yet been determined. You can safely query - and change resources, though. + and change resources and options, though. For many purposes the + "on_start" hook is a better place. + + on_start $term + Called at the very end of initialisation of a new terminal, just + before trying to map (display) the toplevel and returning to the + mainloop. + + on_destroy $term + Called whenever something tries to destroy terminal, before doing + anything yet. If this hook returns true, then destruction is + skipped, but this is rarely a good idea. on_reset $term Called after the screen is "reset" for any reason, such as resizing or control sequences. Here is where you can react on changes to size-related variables. - on_start $term - Called at the very end of initialisation of a new terminal, just - before returning to the mainloop. - on_child_start $term, $pid Called just after the child process has been "fork"ed. @@ -399,6 +437,7 @@ rxvt-unicode does focus out processing. on_configure_notify $term, $event + on_property_notify $term, $event on_key_press $term, $event, $keysym, $octets on_key_release $term, $event, $keysym on_button_press $term, $event @@ -412,13 +451,20 @@ The event is a hash with most values as named by Xlib (see the XEvent manpage), with the additional members "row" and "col", which - are the row and column under the mouse cursor. + are the (real, not screen-based) row and column under the mouse + cursor. "on_key_press" additionally receives the string rxvt-unicode would output, if any, in locale-specific encoding. subwindow. + on_client_message $term, $event + on_wm_protocols $term, $event + on_wm_delete_window $term, $event + Called when various types of ClientMessage events are received (all + with format=32, WM_PROTOCOLS or WM_PROTOCOLS:WM_DELETE_WINDOW). + Variables in the "urxvt" Package $urxvt::LIBDIR The rxvt-unicode library directory, where, among other things, the @@ -435,6 +481,22 @@ The current terminal. This variable stores the current "urxvt::term" object, whenever a callback/hook is executing. + @urxvt::TERM_INIT + All coderefs in this array will be called as methods of the next + newly created "urxvt::term" object (during the "on_init" phase). The + array gets cleared before the codereferences that were in it are + being executed, so coderefs can push themselves onto it again if + they so desire. + + This complements to the perl-eval commandline option, but gets + executed first. + + @urxvt::TERM_EXT + Works similar to @TERM_INIT, but contains perl package/class names, + which get registered as normal extensions after calling the hooks in + @TERM_INIT but before other extensions. Gets cleared just like + @TERM_INIT. + Functions in the "urxvt" Package urxvt::fatal $errormessage Fatally aborts execution with the given error message. Avoid at all @@ -717,6 +779,9 @@ be confused by changes in cursor position or scrolling. Its useful inside a "on_add_lines" hook, though. + $term->scr_change_screen ($screen) + Switch to given screen - 0 primary, 1 secondary. + $term->cmd_parse ($octets) Similar to "scr_add_lines", but the argument must be in the locale-specific encoding of the terminal and can contain command @@ -777,6 +842,12 @@ (often AltGr), the meta key (often Alt) and the num lock key, if applicable. + $screen = $term->current_screen + Returns the currently displayed screen (0 primary, 1 secondary). + + $cursor_is_hidden = $term->hidden_cursor + Returns wether the cursor is currently hidden or not. + $view_start = $term->view_start ([$newvalue]) Returns the row number of the topmost displayed line. Maximum value is 0, which displays the normal terminal contents. Lower values @@ -802,10 +873,10 @@ automatically be updated. $text is in a special encoding: tabs and wide characters that use - more than one cell when displayed are padded with urxvt::NOCHAR - characters ("chr 65535"). Characters with combining characters and - other characters that do not fit into the normal tetx encoding will - be replaced with characters in the private use area. + more than one cell when displayed are padded with $urxvt::NOCHAR + characters. Characters with combining characters and other + characters that do not fit into the normal tetx encoding will be + replaced with characters in the private use area. You have to obey this encoding when changing text. The advantage is that "substr" and similar functions work on screen cells and not on @@ -894,6 +965,25 @@ evaluation errors, as it is better to lose the grab in the error case as the session. + $atom = $term->XInternAtom ($atom_name[, $only_if_exists]) + $atom_name = $term->XGetAtomName ($atom) + @atoms = $term->XListProperties ($window) + ($type,$format,$octets) = $term->XGetWindowProperty ($window, $property) + $term->XChangeWindowProperty ($window, $property, $type, $format, + $octets) + $term->XDeleteProperty ($window, $property) + $window = $term->DefaultRootWindow + $term->XReparentWindow ($window, $parent, [$x, $y]) + $term->XMapWindow ($window) + $term->XUnmapWindow ($window) + $term->XMoveResizeWindow ($window, $x, $y, $width, $height) + ($x, $y, $child_window) = $term->XTranslateCoordinates ($src, $dst, $x, + $y) + $term->XChangeInput ($window, $add_events[, $del_events]) + Various X or X-related functions. The $term object only serves as + the source of the display, otherwise those functions map + more-or-less directory onto the X functions of the same name. + The "urxvt::popup" Class $popup->add_title ($title) Adds a non-clickable title to the popup. @@ -994,6 +1084,49 @@ $iow = $iow->stop Stop watching for events on the given filehandle. + The "urxvt::iw" Class + This class implements idle watchers, that get called automatically when + the process is idle. They should return as fast as possible, after doing + some useful work. + + $iw = new urxvt::iw + Create a new idle watcher object in stopped state. + + $iw = $iw->cb (sub { my ($iw) = @_; ... }) + Set the callback to be called when the watcher triggers. + + $timer = $timer->start + Start the watcher. + + $timer = $timer->stop + Stop the watcher. + + The "urxvt::pw" Class + This class implements process watchers. They create an event whenever a + process exits, after which they stop automatically. + + my $pid = fork; + ... + $term->{pw} = urxvt::pw + ->new + ->start ($pid) + ->cb (sub { + my ($pw, $exit_status) = @_; + ... + }); + + $pw = new urxvt::pw + Create a new process watcher in stopped state. + + $pw = $pw->cb (sub { my ($pw, $exit_status) = @_; ... }) + Set the callback to be called when the timer triggers. + + $pw = $timer->start ($pid) + Tells the wqtcher to start watching for process $pid. + + $pw = $pw->stop + Stop the watcher. + ENVIRONMENT URXVT_PERL_VERBOSITY This variable controls the verbosity level of the perl extension. Higher