ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/doc/rxvtperl.3.txt
(Generate patch)

Comparing rxvt-unicode/doc/rxvtperl.3.txt (file contents):
Revision 1.23 by root, Thu Jan 12 05:37:34 2006 UTC vs.
Revision 1.46 by root, Thu Dec 7 21:31:01 2006 UTC

12 # start a rxvt using it: 12 # start a rxvt using it:
13 13
14 rxvt --perl-lib $HOME -pe grab_test 14 rxvt --perl-lib $HOME -pe grab_test
15 15
16DESCRIPTION 16DESCRIPTION
17 Everytime a terminal object gets created, extension scripts specified 17 Every time a terminal object gets created, extension scripts specified
18 via the "perl" resource are loaded and associated with it. 18 via the "perl" resource are loaded and associated with it.
19 19
20 Scripts are compiled in a 'use strict' and 'use utf8' environment, and 20 Scripts are compiled in a 'use strict' and 'use utf8' environment, and
21 thus must be encoded as UTF-8. 21 thus must be encoded as UTF-8.
22 22
28 can find them in /opt/rxvt/lib/urxvt/perl/. 28 can find them in /opt/rxvt/lib/urxvt/perl/.
29 29
30 You can activate them like this: 30 You can activate them like this:
31 31
32 rxvt -pe <extensionname> 32 rxvt -pe <extensionname>
33
34 Or by adding them to the resource for extensions loaded by default:
35
36 URxvt.perl-ext-common: default,automove-background,selection-autotransform
33 37
34 selection (enabled by default) 38 selection (enabled by default)
35 (More) intelligent selection. This extension tries to be more 39 (More) intelligent selection. This extension tries to be more
36 intelligent when the user extends selections (double-click and 40 intelligent when the user extends selections (double-click and
37 further clicks). Right now, it tries to select words, urls and 41 further clicks). Right now, it tries to select words, urls and
39 your ls supports "--quoting-style=shell". 43 your ls supports "--quoting-style=shell".
40 44
41 A double-click usually selects the word under the cursor, further 45 A double-click usually selects the word under the cursor, further
42 clicks will enlarge the selection. 46 clicks will enlarge the selection.
43 47
48 The selection works by trying to match a number of regexes and
49 displaying them in increasing order of length. You can add your own
50 regexes by specifying resources of the form:
51
52 URxvt.selection.pattern-0: perl-regex
53 URxvt.selection.pattern-1: perl-regex
54 ...
55
56 The index number (0, 1...) must not have any holes, and each regex
57 must contain at least one pair of capturing parentheses, which will
58 be used for the match. For example, the following adds a regex that
59 matches everything between two vertical bars:
60
61 URxvt.selection.pattern-0: \\|([^|]+)\\|
62
63 Another example: Programs I use often output "absolute path: " at
64 the beginning of a line when they process multiple files. The
65 following pattern matches the filename (note, there is a single
66 space at the very end):
67
68 URxvt.selection.pattern-0: ^(/[^:]+):\
69
70 You can look at the source of the selection extension to see more
71 interesting uses, such as parsing a line from beginning to end.
72
44 It also offers the following bindable keyboard command: 73 This extension also offers following bindable keyboard commands:
45 74
46 rot13 75 rot13
47 Rot-13 the selection when activated. Used via keyboard trigger: 76 Rot-13 the selection when activated. Used via keyboard trigger:
48 77
49 URxvt.keysym.C-M-r: perl:selection:rot13 78 URxvt.keysym.C-M-r: perl:selection:rot13
50 79
51 option-popup (enabled by default) 80 option-popup (enabled by default)
52 Binds a popup menu to Ctrl-Button2 that lets you toggle (some) 81 Binds a popup menu to Ctrl-Button2 that lets you toggle (some)
53 options at runtime. 82 options at runtime.
54 83
84 Other extensions can extend this popup menu by pushing a code
85 reference onto "@{ $term-"{option_popup_hook} }>, which gets called
86 whenever the popup is being displayed.
87
88 It's sole argument is the popup menu, which can be modified. It
89 should either return nothing or a string, the initial boolean value
90 and a code reference. The string will be used as button text and the
91 code reference will be called when the toggle changes, with the new
92 boolean value as first argument.
93
94 The following will add an entry "myoption" that changes
95 "$self-"{myoption}>:
96
97 push @{ $self->{term}{option_popup_hook} }, sub {
98 ("my option" => $myoption, sub { $self->{myoption} = $_[0] })
99 };
100
55 selection-popup (enabled by default) 101 selection-popup (enabled by default)
56 Binds a popup menu to Ctrl-Button3 that lets you convert the 102 Binds a popup menu to Ctrl-Button3 that lets you convert the
57 selection text into various other formats/action (such as uri 103 selection text into various other formats/action (such as uri
58 unescaping, perl evalution, web-browser starting etc.), depending on 104 unescaping, perl evaluation, web-browser starting etc.), depending
59 content. 105 on content.
106
107 Other extensions can extend this popup menu by pushing a code
108 reference onto "@{ $term-"{selection_popup_hook} }>, which gets
109 called whenever the popup is being displayed.
110
111 It's sole argument is the popup menu, which can be modified. The
112 selection is in $_, which can be used to decide whether to add
113 something or not. It should either return nothing or a string and a
114 code reference. The string will be used as button text and the code
115 reference will be called when the button gets activated and should
116 transform $_.
117
118 The following will add an entry "a to b" that transforms all "a"s in
119 the selection to "b"s, but only if the selection currently contains
120 any "a"s:
121
122 push @{ $self->{term}{selection_popup_hook} }, sub {
123 /a/ ? ("a to be" => sub { s/a/b/g }
124 : ()
125 };
60 126
61 searchable-scrollback<hotkey> (enabled by default) 127 searchable-scrollback<hotkey> (enabled by default)
62 Adds regex search functionality to the scrollback buffer, triggered 128 Adds regex search functionality to the scrollback buffer, triggered
63 by a hotkey (default: "M-s"). While in search mode, normal terminal 129 by a hotkey (default: "M-s"). While in search mode, normal terminal
64 input/output is suspended and a regex is displayed at the bottom of 130 input/output is suspended and a regex is displayed at the bottom of
70 "End" jumps to the bottom. "Escape" leaves search mode and returns 136 "End" jumps to the bottom. "Escape" leaves search mode and returns
71 to the point where search was started, while "Enter" or "Return" 137 to the point where search was started, while "Enter" or "Return"
72 stay at the current position and additionally stores the first match 138 stay at the current position and additionally stores the first match
73 in the current line into the primary selection. 139 in the current line into the primary selection.
74 140
141 The regex defaults to "(?i)", resulting in a case-insensitive
142 search. To get a case-sensitive search you can delete this prefix
143 using "BackSpace" or simply use an uppercase character which removes
144 the "(?i)" prefix.
145
146 See perlre for more info about perl regular expression syntax.
147
148 readline (enabled by default)
149 A support package that tries to make editing with readline easier.
150 At the moment, it reacts to clicking shift-left mouse button by
151 trying to move the text cursor to this position. It does so by
152 generating as many cursor-left or cursor-right keypresses as
153 required (the this only works for programs that correctly support
154 wide characters).
155
156 To avoid too many false positives, this is only done when:
157
158 - the tty is in ICANON state.
159 - the text cursor is visible.
160 - the primary screen is currently being displayed.
161 - the mouse is on the same (multi-row-) line as the text cursor.
162
163 The normal selection mechanism isn't disabled, so quick successive
164 clicks might interfere with selection creation in harmless ways.
165
166 selection-autotransform
167 This selection allows you to do automatic transforms on a selection
168 whenever a selection is made.
169
170 It works by specifying perl snippets (most useful is a single "s///"
171 operator) that modify $_ as resources:
172
173 URxvt.selection-autotransform.0: transform
174 URxvt.selection-autotransform.1: transform
175 ...
176
177 For example, the following will transform selections of the form
178 "filename:number", often seen in compiler messages, into "vi
179 +$filename $word":
180
181 URxvt.selection-autotransform.0: s/^([^:[:space:]]+):(\\d+):?$/vi +$2 \\Q$1\\E\\x0d/
182
183 And this example matches the same,but replaces it with vi-commands
184 you can paste directly into your (vi :) editor:
185
186 URxvt.selection-autotransform.0: s/^([^:[:space:]]+(\\d+):?$/:e \\Q$1\\E\\x0d:$2\\x0d/
187
188 Of course, this can be modified to suit your needs and your editor
189 :)
190
191 To expand the example above to typical perl error messages ("XXX at
192 FILENAME line YYY."), you need a slightly more elaborate solution:
193
194 URxvt.selection.pattern-0: ( at .*? line \\d+[,.])
195 URxvt.selection-autotransform.0: s/^ at (.*?) line (\\d+)[,.]$/:e \\Q$1\E\\x0d:$2\\x0d/
196
197 The first line tells the selection code to treat the unchanging part
198 of every error message as a selection pattern, and the second line
199 transforms the message into vi commands to load the file.
200
201 tabbed
202 This transforms the terminal into a tabbar with additional
203 terminals, that is, it implements what is commonly referred to as
204 "tabbed terminal". The topmost line displays a "[NEW]" button,
205 which, when clicked, will add a new tab, followed by one button per
206 tab.
207
208 Clicking a button will activate that tab. Pressing Shift-Left and
209 Shift-Right will switch to the tab left or right of the current one,
210 while Shift-Down creates a new tab.
211
212 The tabbar itself can be configured similarly to a normal terminal,
213 but with a resource class of "URxvt.tabbed". In addition, it
214 supports the following four resources (shown with defaults):
215
216 URxvt.tabbed.tabbar-fg: <colour-index, default 3>
217 URxvt.tabbed.tabbar-bg: <colour-index, default 0>
218 URxvt.tabbed.tab-fg: <colour-index, default 0>
219 URxvt.tabbed.tab-bg: <colour-index, default 1>
220
221 See *COLOR AND GRAPHICS* in the rxvt(1) manpage for valid indices.
222
223 matcher
224 Uses per-line display filtering ("on_line_update") to underline text
225 matching a certain pattern and make it clickable. When clicked with
226 the mouse button specified in the "matcher.button" resource (default
227 2, or middle), the program specified in the "matcher.launcher"
228 resource (default, the "urlLauncher" resource, "sensible-browser")
229 will be started with the matched text as first argument. The default
230 configuration is suitable for matching URLs and launching a web
231 browser, like the former "mark-urls" extension.
232
233 The default pattern to match URLs can be overridden with the
234 "matcher.pattern.0" resource, and additional patterns can be
235 specified with numbered patterns, in a manner similar to the
236 "selection" extension. The launcher can also be overridden on a
237 per-pattern basis.
238
239 Example configuration:
240
241 URxvt.perl-ext: default,matcher
242 URxvt.urlLauncher: sensible-browser
243 URxvt.matcher.button: 1
244 URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-]
245 URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$)
246 URxvt.matcher.launcher.2: gvim +$2 $1
247
248 xim-onthespot
249 This (experimental) perl extension implements OnTheSpot editing. It
250 does not work perfectly, and some input methods don't seem to work
251 well with OnTheSpot editing in general, but it seems to work at
252 leats for SCIM and kinput2.
253
254 You enable it by specifying this extension and a preedit style of
255 "OnTheSpot", i.e.:
256
257 rxvt -pt OnTheSpot -pe xim-onthespot
258
259 kuake<hotkey>
260 A very primitive quake-console-like extension. It was inspired by a
261 description of how the programs "kuake" and "yakuake" work: Whenever
262 the user presses a global accelerator key (by default "F10"), the
263 terminal will show or hide itself. Another press of the accelerator
264 key will hide or show it again.
265
266 Initially, the window will not be shown when using this extension.
267
268 This is useful if you need a single terminal thats not using any
269 desktop space most of the time but is quickly available at the press
270 of a key.
271
272 The accelerator key is grabbed regardless of any modifiers, so this
273 extension will actually grab a physical key just for this function.
274
275 If you want a quake-like animation, tell your window manager to do
276 so (fvwm can do it).
277
278 automove-background
279 This is basically a very small extension that dynamically changes
280 the background pixmap offset to the window position, in effect
281 creating the same effect as pseudo transparency with a custom
282 pixmap. No scaling is supported in this mode. Example:
283
284 rxvt -pixmap background.xpm -pe automove-background
285
286 block-graphics-to-ascii
287 A not very useful example of filtering all text output to the
288 terminal by replacing all line-drawing characters (U+2500 .. U+259F)
289 by a similar-looking ascii character.
290
75 digital-clock 291 digital-clock
76 Displays a digital clock using the built-in overlay. 292 Displays a digital clock using the built-in overlay.
77 293
78 mark-urls 294 remote-clipboard
79 Uses per-line display filtering ("on_line_update") to underline urls 295 Somewhat of a misnomer, this extension adds two menu entries to the
80 and make them clickable. When middle-clicked, the program specified 296 selection popup that allows one ti run external commands to store
81 in the resource "urlLauncher" (default "x-www-browser") will be 297 the selection somewhere and fetch it again.
82 started with the URL as first argument.
83 298
84 block-graphics-to-ascii 299 We use it to implement a "distributed selection mechanism", which
85 A not very useful example of filtering all text output to the 300 just means that one command uploads the file to a remote server, and
86 terminal, by replacing all line-drawing characters (U+2500 .. 301 another reads it.
87 U+259F) by a similar-looking ascii character. 302
303 The commands can be set using the "URxvt.remote-selection.store" and
304 "URxvt.remote-selection.fetch" resources. The first should read the
305 selection to store from STDIN (always in UTF-8), the second should
306 provide the selection data on STDOUT (also in UTF-8).
307
308 The defaults (which are likely useless to you) use rsh and cat:
309
310 URxvt.remote-selection.store: rsh ruth 'cat >/tmp/distributed-selection'
311 URxvt.remote-selection.fetch: rsh ruth 'cat /tmp/distributed-selection'
312
313 selection-pastebin
314 This is a little rarely useful extension that Uploads the selection
315 as textfile to a remote site (or does other things). (The
316 implementation is not currently secure for use in a multiuser
317 environment as it writes to /tmp directly.).
318
319 It listens to the "selection-pastebin:remote-pastebin" keyboard
320 command, i.e.
321
322 URxvt.keysym.C-M-e: perl:selection-pastebin:remote-pastebin
323
324 Pressing this combination runs a command with "%" replaced by the
325 name of the textfile. This command can be set via a resource:
326
327 URxvt.selection-pastebin.cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/.
328
329 And the default is likely not useful to anybody but the few people
330 around here :)
331
332 The name of the textfile is the hex encoded md5 sum of the
333 selection, so the same content should lead to the same filename.
334
335 After a successful upload the selection will be replaced by the text
336 given in the "selection-pastebin-url" resource (again, the % is the
337 placeholder for the filename):
338
339 URxvt.selection-pastebin.url: http://www.ta-sa.org/files/txt/%
340
341 *Note to xrdb users:* xrdb uses the C preprocessor, which might
342 interpret the double "/" characters as comment start. Use "\057\057"
343 instead, which works regardless of wether xrdb is used to parse the
344 resource file or not.
345
346 macosx-clipboard
347 An extension for use on Mac OS X that enabled rxvt to use the system
348 clipboard by implementing two keyboard events.
349
350 This example configuration enables the extension and binds the copy
351 and paste functionality to Meta-C and Meta-V:
352
353 URxvt.perl-ext-common: default,macosx-clipboard
354 URxvt.keysym.M-c: perl:macosx-clipboard:copy
355 URxvt.keysym.M-v: perl:macosx-clipboard:paste
88 356
89 example-refresh-hooks 357 example-refresh-hooks
90 Displays a very simple digital clock in the upper right corner of 358 Displays a very simple digital clock in the upper right corner of
91 the window. Illustrates overwriting the refresh callbacks to create 359 the window. Illustrates overwriting the refresh callbacks to create
92 your own overlays or changes. 360 your own overlays or changes.
120 $octets 388 $octets
121 Either binary data or - more common - a text string encoded in a 389 Either binary data or - more common - a text string encoded in a
122 locale-specific way. 390 locale-specific way.
123 391
124 Extension Objects 392 Extension Objects
125 Very perl extension is a perl class. A separate perl object is created 393 Every perl extension is a perl class. A separate perl object is created
126 for each terminal and each extension and passed as the first parameter 394 for each terminal, and each terminal has its own set of extenion
127 to hooks. So extensions can use their $self object without having to 395 objects, which are passed as the first parameter to hooks. So extensions
128 think about other extensions, with the exception of methods and members 396 can use their $self object without having to think about clashes with
397 other extensions or other terminals, with the exception of methods and
129 that begin with an underscore character "_": these are reserved for 398 members that begin with an underscore character "_": these are reserved
130 internal use. 399 for internal use.
131 400
132 Although it isn't a "urxvt::term" object, you can call all methods of 401 Although it isn't a "urxvt::term" object, you can call all methods of
133 the "urxvt::term" class on this object. 402 the "urxvt::term" class on this object.
134 403
135 It has the following methods and data members: 404 It has the following methods and data members:
148 417
149 Hooks 418 Hooks
150 The following subroutines can be declared in extension files, and will 419 The following subroutines can be declared in extension files, and will
151 be called whenever the relevant event happens. 420 be called whenever the relevant event happens.
152 421
153 The first argument passed to them is an extension oject as described in 422 The first argument passed to them is an extension object as described in
154 the in the "Extension Objects" section. 423 the in the "Extension Objects" section.
155 424
156 All of these hooks must return a boolean value. If it is true, then the 425 All of these hooks must return a boolean value. If any of the called
157 event counts as being *consumed*, and the invocation of other hooks is 426 hooks returns true, then the event counts as being *consumed*, and the
158 skipped, and the relevant action might not be carried out by the C++ 427 relevant action might not be carried out by the C++ code.
159 code.
160 428
161 *When in doubt, return a false value (preferably "()").* 429 *When in doubt, return a false value (preferably "()").*
162 430
163 on_init $term 431 on_init $term
164 Called after a new terminal object has been initialized, but before 432 Called after a new terminal object has been initialized, but before
165 windows are created or the command gets run. Most methods are unsafe 433 windows are created or the command gets run. Most methods are unsafe
166 to call or deliver senseless data, as terminal size and other 434 to call or deliver senseless data, as terminal size and other
167 characteristics have not yet been determined. You can safely query 435 characteristics have not yet been determined. You can safely query
168 and change resources, though. 436 and change resources and options, though. For many purposes the
437 "on_start" hook is a better place.
438
439 on_start $term
440 Called at the very end of initialisation of a new terminal, just
441 before trying to map (display) the toplevel and returning to the
442 main loop.
443
444 on_destroy $term
445 Called whenever something tries to destroy terminal, when the
446 terminal is still fully functional (not for long, though).
169 447
170 on_reset $term 448 on_reset $term
171 Called after the screen is "reset" for any reason, such as resizing 449 Called after the screen is "reset" for any reason, such as resizing
172 or control sequences. Here is where you can react on changes to 450 or control sequences. Here is where you can react on changes to
173 size-related variables. 451 size-related variables.
174 452
175 on_start $term 453 on_child_start $term, $pid
176 Called at the very end of initialisation of a new terminal, just 454 Called just after the child process has been "fork"ed.
177 before returning to the mainloop. 455
456 on_child_exit $term, $status
457 Called just after the child process has exited. $status is the
458 status from "waitpid".
178 459
179 on_sel_make $term, $eventtime 460 on_sel_make $term, $eventtime
180 Called whenever a selection has been made by the user, but before 461 Called whenever a selection has been made by the user, but before
181 the selection text is copied, so changes to the beginning, end or 462 the selection text is copied, so changes to the beginning, end or
182 type of the selection will be honored. 463 type of the selection will be honored.
189 Called whenever a selection has been copied, but before the 470 Called whenever a selection has been copied, but before the
190 selection is requested from the server. The selection text can be 471 selection is requested from the server. The selection text can be
191 queried and changed by calling "$term->selection". 472 queried and changed by calling "$term->selection".
192 473
193 Returning a true value aborts selection grabbing. It will still be 474 Returning a true value aborts selection grabbing. It will still be
194 hilighted. 475 highlighted.
195 476
196 on_sel_extend $term 477 on_sel_extend $term
197 Called whenever the user tries to extend the selection (e.g. with a 478 Called whenever the user tries to extend the selection (e.g. with a
198 double click) and is either supposed to return false (normal 479 double click) and is either supposed to return false (normal
199 operation), or should extend the selection itelf and return true to 480 operation), or should extend the selection itself and return true to
200 suppress the built-in processing. This can happen multiple times, as 481 suppress the built-in processing. This can happen multiple times, as
201 long as the callback returns true, it will be called on every 482 long as the callback returns true, it will be called on every
202 further click by the user and is supposed to enlarge the selection 483 further click by the user and is supposed to enlarge the selection
203 more and more, if possible. 484 more and more, if possible.
204 485
205 See the selection example extension. 486 See the selection example extension.
206 487
207 on_view_change $term, $offset 488 on_view_change $term, $offset
208 Called whenever the view offset changes, i..e the user or program 489 Called whenever the view offset changes, i.e. the user or program
209 scrolls. Offset 0 means display the normal terminal, positive values 490 scrolls. Offset 0 means display the normal terminal, positive values
210 show this many lines of scrollback. 491 show this many lines of scrollback.
211 492
212 on_scroll_back $term, $lines, $saved 493 on_scroll_back $term, $lines, $saved
213 Called whenever lines scroll out of the terminal area into the 494 Called whenever lines scroll out of the terminal area into the
216 497
217 It is called before lines are scrolled out (so rows 0 .. min ($lines 498 It is called before lines are scrolled out (so rows 0 .. min ($lines
218 - 1, $nrow - 1) represent the lines to be scrolled out). $saved is 499 - 1, $nrow - 1) represent the lines to be scrolled out). $saved is
219 the total number of lines that will be in the scrollback buffer. 500 the total number of lines that will be in the scrollback buffer.
220 501
502 on_osc_seq $term, $op, $args
503 Called on every OSC sequence and can be used to suppress it or
504 modify its behaviour. The default should be to return an empty list.
505 A true value suppresses execution of the request completely. Make
506 sure you don't get confused by recursive invocations when you output
507 an osc sequence within this callback.
508
509 "on_osc_seq_perl" should be used for new behaviour.
510
221 on_osc_seq $term, $string 511 on_osc_seq_perl $term, $string
222 Called whenever the ESC ] 777 ; string ST command sequence (OSC = 512 Called whenever the ESC ] 777 ; string ST command sequence (OSC =
223 operating system command) is processed. Cursor position and other 513 operating system command) is processed. Cursor position and other
224 state information is up-to-date when this happens. For 514 state information is up-to-date when this happens. For
225 interoperability, the string should start with the extension name 515 interoperability, the string should start with the extension name
226 and a colon, to distinguish it from commands for other extensions, 516 and a colon, to distinguish it from commands for other extensions,
227 and this might be enforced in the future. 517 and this might be enforced in the future.
228 518
229 Be careful not ever to trust (in a security sense) the data you 519 Be careful not ever to trust (in a security sense) the data you
230 receive, as its source can not easily be controleld (e-mail content, 520 receive, as its source can not easily be controlled (e-mail content,
231 messages from other users on the same system etc.). 521 messages from other users on the same system etc.).
232 522
233 on_add_lines $term, $string 523 on_add_lines $term, $string
234 Called whenever text is about to be output, with the text as 524 Called whenever text is about to be output, with the text as
235 argument. You can filter/change and output the text yourself by 525 argument. You can filter/change and output the text yourself by
262 display code is run after this hook, and takes precedence. 552 display code is run after this hook, and takes precedence.
263 553
264 on_refresh_end $term 554 on_refresh_end $term
265 Called just after the screen gets redrawn. See "on_refresh_begin". 555 Called just after the screen gets redrawn. See "on_refresh_begin".
266 556
267 on_keyboard_command $term, $string 557 on_user_command $term, $string
268 Called whenever the user presses a key combination that has a 558 Called whenever a user-configured event is being activated (e.g. via
269 "perl:string" action bound to it (see description of the keysym 559 a "perl:string" action bound to a key, see description of the keysym
270 resource in the rxvt(1) manpage). 560 resource in the rxvt(1) manpage).
561
562 The event is simply the action string. This interface is assumed to
563 change slightly in the future.
564
565 on_resize_all_windows $tern, $new_width, $new_height
566 Called just after the new window size has been calculated, but
567 before windows are actually being resized or hints are being set. If
568 this hook returns TRUE, setting of the window hints is being
569 skipped.
570
571 on_x_event $term, $event
572 Called on every X event received on the vt window (and possibly
573 other windows). Should only be used as a last resort. Most event
574 structure members are not passed.
575
576 on_root_event $term, $event
577 Like "on_x_event", but is called for events on the root window.
271 578
272 on_focus_in $term 579 on_focus_in $term
273 Called whenever the window gets the keyboard focus, before 580 Called whenever the window gets the keyboard focus, before
274 rxvt-unicode does focus in processing. 581 rxvt-unicode does focus in processing.
275 582
276 on_focus_out $term 583 on_focus_out $term
277 Called wheneever the window loses keyboard focus, before 584 Called whenever the window loses keyboard focus, before rxvt-unicode
278 rxvt-unicode does focus out processing. 585 does focus out processing.
279 586
587 on_configure_notify $term, $event
588 on_property_notify $term, $event
280 on_key_press $term, $event, $keysym, $octets 589 on_key_press $term, $event, $keysym, $octets
281 on_key_release $term, $event, $keysym 590 on_key_release $term, $event, $keysym
282 on_button_press $term, $event 591 on_button_press $term, $event
283 on_button_release $term, $event 592 on_button_release $term, $event
284 on_motion_notify $term, $event 593 on_motion_notify $term, $event
288 terminal If the hook returns true, then the even will be ignored by 597 terminal If the hook returns true, then the even will be ignored by
289 rxvt-unicode. 598 rxvt-unicode.
290 599
291 The event is a hash with most values as named by Xlib (see the 600 The event is a hash with most values as named by Xlib (see the
292 XEvent manpage), with the additional members "row" and "col", which 601 XEvent manpage), with the additional members "row" and "col", which
293 are the row and column under the mouse cursor. 602 are the (real, not screen-based) row and column under the mouse
603 cursor.
294 604
295 "on_key_press" additionally receives the string rxvt-unicode would 605 "on_key_press" additionally receives the string rxvt-unicode would
296 output, if any, in locale-specific encoding. 606 output, if any, in locale-specific encoding.
297 607
298 subwindow. 608 subwindow.
609
610 on_client_message $term, $event
611 on_wm_protocols $term, $event
612 on_wm_delete_window $term, $event
613 Called when various types of ClientMessage events are received (all
614 with format=32, WM_PROTOCOLS or WM_PROTOCOLS:WM_DELETE_WINDOW).
299 615
300 Variables in the "urxvt" Package 616 Variables in the "urxvt" Package
301 $urxvt::LIBDIR 617 $urxvt::LIBDIR
302 The rxvt-unicode library directory, where, among other things, the 618 The rxvt-unicode library directory, where, among other things, the
303 perl modules and scripts are stored. 619 perl modules and scripts are stored.
310 The basename of the installed binaries, usually "urxvt". 626 The basename of the installed binaries, usually "urxvt".
311 627
312 $urxvt::TERM 628 $urxvt::TERM
313 The current terminal. This variable stores the current "urxvt::term" 629 The current terminal. This variable stores the current "urxvt::term"
314 object, whenever a callback/hook is executing. 630 object, whenever a callback/hook is executing.
631
632 @urxvt::TERM_INIT
633 All code references in this array will be called as methods of the
634 next newly created "urxvt::term" object (during the "on_init"
635 phase). The array gets cleared before the code references that were
636 in it are being executed, so references can push themselves onto it
637 again if they so desire.
638
639 This complements to the perl-eval command line option, but gets
640 executed first.
641
642 @urxvt::TERM_EXT
643 Works similar to @TERM_INIT, but contains perl package/class names,
644 which get registered as normal extensions after calling the hooks in
645 @TERM_INIT but before other extensions. Gets cleared just like
646 @TERM_INIT.
315 647
316 Functions in the "urxvt" Package 648 Functions in the "urxvt" Package
317 urxvt::fatal $errormessage 649 urxvt::fatal $errormessage
318 Fatally aborts execution with the given error message. Avoid at all 650 Fatally aborts execution with the given error message. Avoid at all
319 costs! The only time this is acceptable is when the terminal process 651 costs! The only time this is acceptable is when the terminal process
327 Using this function has the advantage that its output ends up in the 659 Using this function has the advantage that its output ends up in the
328 correct place, e.g. on stderr of the connecting urxvtc client. 660 correct place, e.g. on stderr of the connecting urxvtc client.
329 661
330 Messages have a size limit of 1023 bytes currently. 662 Messages have a size limit of 1023 bytes currently.
331 663
332 $is_safe = urxvt::safe 664 @terms = urxvt::termlist
333 Returns true when it is safe to do potentially unsafe things, such 665 Returns all urxvt::term objects that exist in this process,
334 as evaluating perl code specified by the user. This is true when 666 regardless of whether they are started, being destroyed etc., so be
335 urxvt was started setuid or setgid. 667 careful. Only term objects that have perl extensions attached will
668 be returned (because there is no urxvt::term objet associated with
669 others).
336 670
337 $time = urxvt::NOW 671 $time = urxvt::NOW
338 Returns the "current time" (as per the event loop). 672 Returns the "current time" (as per the event loop).
339 673
340 urxvt::CurrentTime 674 urxvt::CurrentTime
341 urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, 675 urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask,
342 Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask, Button4Mask, 676 Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask, Button4Mask,
343 Button5Mask, AnyModifier 677 Button5Mask, AnyModifier
678 urxvt::NoEventMask, KeyPressMask, KeyReleaseMask, ButtonPressMask,
679 ButtonReleaseMask, EnterWindowMask, LeaveWindowMask, PointerMotionMask,
680 PointerMotionHintMask, Button1MotionMask, Button2MotionMask,
681 Button3MotionMask, Button4MotionMask, Button5MotionMask,
682 ButtonMotionMask, KeymapStateMask, ExposureMask, VisibilityChangeMask,
683 StructureNotifyMask, ResizeRedirectMask, SubstructureNotifyMask,
684 SubstructureRedirectMask, FocusChangeMask, PropertyChangeMask,
685 ColormapChangeMask, OwnerGrabButtonMask
686 urxvt::KeyPress, KeyRelease, ButtonPress, ButtonRelease, MotionNotify,
687 EnterNotify, LeaveNotify, FocusIn, FocusOut, KeymapNotify, Expose,
688 GraphicsExpose, NoExpose, VisibilityNotify, CreateNotify, DestroyNotify,
689 UnmapNotify, MapNotify, MapRequest, ReparentNotify, ConfigureNotify,
690 ConfigureRequest, GravityNotify, ResizeRequest, CirculateNotify,
691 CirculateRequest, PropertyNotify, SelectionClear, SelectionRequest,
692 SelectionNotify, ColormapNotify, ClientMessage, MappingNotify
344 Various constants for use in X calls and event processing. 693 Various constants for use in X calls and event processing.
345 694
346 RENDITION 695 RENDITION
347 Rendition bitsets contain information about colour, font, font styles 696 Rendition bitsets contain information about colour, font, font styles
348 and similar information for each screen cell. 697 and similar information for each screen cell.
369 $background = urxvt::GET_BASEBG $rend 718 $background = urxvt::GET_BASEBG $rend
370 Return the foreground/background colour index, respectively. 719 Return the foreground/background colour index, respectively.
371 720
372 $rend = urxvt::SET_FGCOLOR $rend, $new_colour 721 $rend = urxvt::SET_FGCOLOR $rend, $new_colour
373 $rend = urxvt::SET_BGCOLOR $rend, $new_colour 722 $rend = urxvt::SET_BGCOLOR $rend, $new_colour
723 $rend = urxvt::SET_COLOR $rend, $new_fg, $new_bg
374 Replace the foreground/background colour in the rendition mask with 724 Replace the foreground/background colour in the rendition mask with
375 the specified one. 725 the specified one.
376 726
377 $value = urxvt::GET_CUSTOM $rend 727 $value = urxvt::GET_CUSTOM $rend
378 Return the "custom" value: Every rendition has 5 bits for use by 728 Return the "custom" value: Every rendition has 5 bits for use by
397 %ENV-like hash which defines the environment of the new terminal. 747 %ENV-like hash which defines the environment of the new terminal.
398 748
399 Croaks (and probably outputs an error message) if the new instance 749 Croaks (and probably outputs an error message) if the new instance
400 couldn't be created. Returns "undef" if the new instance didn't 750 couldn't be created. Returns "undef" if the new instance didn't
401 initialise perl, and the terminal object otherwise. The "init" and 751 initialise perl, and the terminal object otherwise. The "init" and
402 "start" hooks will be called during this call. 752 "start" hooks will be called before this call returns, and are free
753 to refer to global data (which is race free).
403 754
404 $term->destroy 755 $term->destroy
405 Destroy the terminal object (close the window, free resources etc.). 756 Destroy the terminal object (close the window, free resources etc.).
406 Please note that rxvt will not exit as long as any event watchers 757 Please note that rxvt will not exit as long as any event watchers
407 (timers, io watchers) are still active. 758 (timers, io watchers) are still active.
759
760 $term->exec_async ($cmd[, @args])
761 Works like the combination of the "fork"/"exec" builtins, which
762 executes ("starts") programs in the background. This function takes
763 care of setting the user environment before exec'ing the command
764 (e.g. "PATH") and should be preferred over explicit calls to "exec"
765 or "system".
766
767 Returns the pid of the subprocess or "undef" on error.
408 768
409 $isset = $term->option ($optval[, $set]) 769 $isset = $term->option ($optval[, $set])
410 Returns true if the option specified by $optval is enabled, and 770 Returns true if the option specified by $optval is enabled, and
411 optionally change it. All option values are stored by name in the 771 optionally change it. All option values are stored by name in the
412 hash %urxvt::OPTION. Options not enabled in this binary are not in 772 hash %urxvt::OPTION. Options not enabled in this binary are not in
413 the hash. 773 the hash.
414 774
415 Here is a a likely non-exhaustive list of option names, please see 775 Here is a likely non-exhaustive list of option names, please see the
416 the source file /src/optinc.h to see the actual list: 776 source file /src/optinc.h to see the actual list:
417 777
418 borderLess console cursorBlink cursorUnderline hold iconic insecure 778 borderLess console cursorBlink cursorUnderline hold iconic insecure
419 intensityStyles jumpScroll loginShell mapAlert meta8 mouseWheelScrollPage 779 intensityStyles jumpScroll loginShell mapAlert meta8 mouseWheelScrollPage
420 pastableTabs pointerBlank reverseVideo scrollBar scrollBar_floating 780 override-redirect pastableTabs pointerBlank reverseVideo scrollBar
421 scrollBar_right scrollTtyKeypress scrollTtyOutput scrollWithBuffer 781 scrollBar_floating scrollBar_right scrollTtyKeypress scrollTtyOutput
422 secondaryScreen secondaryScroll skipBuiltinGlyphs transparent 782 scrollWithBuffer secondaryScreen secondaryScroll skipBuiltinGlyphs
423 tripleclickwords utmpInhibit visualBell 783 transparent tripleclickwords utmpInhibit visualBell
424 784
425 $value = $term->resource ($name[, $newval]) 785 $value = $term->resource ($name[, $newval])
426 Returns the current resource value associated with a given name and 786 Returns the current resource value associated with a given name and
427 optionally sets a new value. Setting values is most useful in the 787 optionally sets a new value. Setting values is most useful in the
428 "init" hook. Unset resources are returned and accepted as "undef". 788 "init" hook. Unset resources are returned and accepted as "undef".
437 797
438 Please note that resource strings will currently only be freed when 798 Please note that resource strings will currently only be freed when
439 the terminal is destroyed, so changing options frequently will eat 799 the terminal is destroyed, so changing options frequently will eat
440 memory. 800 memory.
441 801
442 Here is a a likely non-exhaustive list of resource names, not all of 802 Here is a likely non-exhaustive list of resource names, not all of
443 which are supported in every build, please see the source file 803 which are supported in every build, please see the source file
444 /src/rsinc.h to see the actual list: 804 /src/rsinc.h to see the actual list:
445 805
446 answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont 806 answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont
447 borderLess color cursorBlink cursorUnderline cutchars delete_key 807 borderLess color cursorBlink cursorUnderline cutchars delete_key
448 display_name embed ext_bwidth fade font geometry hold iconName 808 display_name embed ext_bwidth fade font geometry hold iconName
449 imFont imLocale inputMethod insecure int_bwidth intensityStyles 809 imFont imLocale inputMethod insecure int_bwidth intensityStyles
450 italicFont jumpScroll lineSpace loginShell mapAlert menu meta8 modifier 810 italicFont jumpScroll lineSpace loginShell mapAlert meta8 modifier
451 mouseWheelScrollPage name pastableTabs path perl_eval perl_ext_1 perl_ext_2 811 mouseWheelScrollPage name override_redirect pastableTabs path perl_eval
452 perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd 812 perl_ext_1 perl_ext_2 perl_lib pointerBlank pointerBlankDelay
453 reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating 813 preeditType print_pipe pty_fd reverseVideo saveLines scrollBar
454 scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput 814 scrollBar_align scrollBar_floating scrollBar_right scrollBar_thickness
455 scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle 815 scrollTtyKeypress scrollTtyOutput scrollWithBuffer scrollstyle
816 secondaryScreen secondaryScroll selectstyle shade term_name title
456 shade term_name title transparent transparent_all tripleclickwords 817 transient_for transparent transparent_all tripleclickwords utmpInhibit
457 utmpInhibit visualBell 818 visualBell
458 819
459 $value = $term->x_resource ($pattern) 820 $value = $term->x_resource ($pattern)
460 Returns the X-Resource for the given pattern, excluding the program 821 Returns the X-Resource for the given pattern, excluding the program
461 or class name, i.e. "$term->x_resource ("boldFont")" should return 822 or class name, i.e. "$term->x_resource ("boldFont")" should return
462 the same value as used by this instance of rxvt-unicode. Returns 823 the same value as used by this instance of rxvt-unicode. Returns
573 934
574 Normally its not a good idea to use this function, as programs might 935 Normally its not a good idea to use this function, as programs might
575 be confused by changes in cursor position or scrolling. Its useful 936 be confused by changes in cursor position or scrolling. Its useful
576 inside a "on_add_lines" hook, though. 937 inside a "on_add_lines" hook, though.
577 938
939 $term->scr_change_screen ($screen)
940 Switch to given screen - 0 primary, 1 secondary.
941
578 $term->cmd_parse ($octets) 942 $term->cmd_parse ($octets)
579 Similar to "scr_add_lines", but the argument must be in the 943 Similar to "scr_add_lines", but the argument must be in the
580 locale-specific encoding of the terminal and can contain command 944 locale-specific encoding of the terminal and can contain command
581 sequences (escape codes) that will be interpreted. 945 sequences (escape codes) that will be interpreted.
582 946
590 Replaces the event mask of the pty watcher by the given event mask. 954 Replaces the event mask of the pty watcher by the given event mask.
591 Can be used to suppress input and output handling to the pty/tty. 955 Can be used to suppress input and output handling to the pty/tty.
592 See the description of "urxvt::timer->events". Make sure to always 956 See the description of "urxvt::timer->events". Make sure to always
593 restore the previous value. 957 restore the previous value.
594 958
959 $fd = $term->pty_fd
960 Returns the master file descriptor for the pty in use, or -1 if no
961 pty is used.
962
595 $windowid = $term->parent 963 $windowid = $term->parent
596 Return the window id of the toplevel window. 964 Return the window id of the toplevel window.
597 965
598 $windowid = $term->vt 966 $windowid = $term->vt
599 Return the window id of the terminal window. 967 Return the window id of the terminal window.
968
969 $term->vt_emask_add ($x_event_mask)
970 Adds the specified events to the vt event mask. Useful e.g. when you
971 want to receive pointer events all the times:
972
973 $term->vt_emask_add (urxvt::PointerMotionMask);
974
975 $term->focus_in
976 $term->focus_out
977 $term->key_press ($state, $keycode[, $time])
978 $term->key_release ($state, $keycode[, $time])
979 Deliver various fake events to to terminal.
600 980
601 $window_width = $term->width 981 $window_width = $term->width
602 $window_height = $term->height 982 $window_height = $term->height
603 $font_width = $term->fwidth 983 $font_width = $term->fwidth
604 $font_height = $term->fheight 984 $font_height = $term->fheight
607 $terminal_columns = $term->ncol 987 $terminal_columns = $term->ncol
608 $has_focus = $term->focus 988 $has_focus = $term->focus
609 $is_mapped = $term->mapped 989 $is_mapped = $term->mapped
610 $max_scrollback = $term->saveLines 990 $max_scrollback = $term->saveLines
611 $nrow_plus_saveLines = $term->total_rows 991 $nrow_plus_saveLines = $term->total_rows
612 $lines_in_scrollback = $term->nsaved 992 $topmost_scrollback_row = $term->top_row
613 Return various integers describing terminal characteristics. 993 Return various integers describing terminal characteristics.
614 994
615 $x_display = $term->display_id 995 $x_display = $term->display_id
616 Return the DISPLAY used by rxvt-unicode. 996 Return the DISPLAY used by rxvt-unicode.
617 997
619 Returns the LC_CTYPE category string used by this rxvt-unicode. 999 Returns the LC_CTYPE category string used by this rxvt-unicode.
620 1000
621 $env = $term->env 1001 $env = $term->env
622 Returns a copy of the environment in effect for the terminal as a 1002 Returns a copy of the environment in effect for the terminal as a
623 hashref similar to "\%ENV". 1003 hashref similar to "\%ENV".
1004
1005 @envv = $term->envv
1006 Returns the environment as array of strings of the form "VAR=VALUE".
1007
1008 @argv = $term->argv
1009 Return the argument vector as this terminal, similar to @ARGV, but
1010 includes the program name as first element.
624 1011
625 $modifiermask = $term->ModLevel3Mask 1012 $modifiermask = $term->ModLevel3Mask
626 $modifiermask = $term->ModMetaMask 1013 $modifiermask = $term->ModMetaMask
627 $modifiermask = $term->ModNumLockMask 1014 $modifiermask = $term->ModNumLockMask
628 Return the modifier masks corresponding to the "ISO Level 3 Shift" 1015 Return the modifier masks corresponding to the "ISO Level 3 Shift"
629 (often AltGr), the meta key (often Alt) and the num lock key, if 1016 (often AltGr), the meta key (often Alt) and the num lock key, if
630 applicable. 1017 applicable.
631 1018
1019 $screen = $term->current_screen
1020 Returns the currently displayed screen (0 primary, 1 secondary).
1021
1022 $cursor_is_hidden = $term->hidden_cursor
1023 Returns whether the cursor is currently hidden or not.
1024
632 $view_start = $term->view_start ([$newvalue]) 1025 $view_start = $term->view_start ([$newvalue])
633 Returns the negative row number of the topmost line. Minimum value 1026 Returns the row number of the topmost displayed line. Maximum value
634 is 0, which displays the normal terminal contents. Larger values 1027 is 0, which displays the normal terminal contents. Lower values
635 scroll this many lines into the scrollback buffer. 1028 scroll this many lines into the scrollback buffer.
636 1029
637 $term->want_refresh 1030 $term->want_refresh
638 Requests a screen refresh. At the next opportunity, rxvt-unicode 1031 Requests a screen refresh. At the next opportunity, rxvt-unicode
639 will compare the on-screen display with its stored representation. 1032 will compare the on-screen display with its stored representation.
652 line, starting at column $start_col (default 0), which is useful to 1045 line, starting at column $start_col (default 0), which is useful to
653 replace only parts of a line. The font index in the rendition will 1046 replace only parts of a line. The font index in the rendition will
654 automatically be updated. 1047 automatically be updated.
655 1048
656 $text is in a special encoding: tabs and wide characters that use 1049 $text is in a special encoding: tabs and wide characters that use
657 more than one cell when displayed are padded with urxvt::NOCHAR 1050 more than one cell when displayed are padded with $urxvt::NOCHAR
658 characters ("chr 65535"). Characters with combining characters and 1051 (chr 65535) characters. Characters with combining characters and
659 other characters that do not fit into the normal tetx encoding will 1052 other characters that do not fit into the normal tetx encoding will
660 be replaced with characters in the private use area. 1053 be replaced with characters in the private use area.
661 1054
662 You have to obey this encoding when changing text. The advantage is 1055 You have to obey this encoding when changing text. The advantage is
663 that "substr" and similar functions work on screen cells and not on 1056 that "substr" and similar functions work on screen cells and not on
719 Converts a perl string into the special encoding used by 1112 Converts a perl string into the special encoding used by
720 rxvt-unicode, where one character corresponds to one screen cell. 1113 rxvt-unicode, where one character corresponds to one screen cell.
721 See "$term->ROW_t" for details. 1114 See "$term->ROW_t" for details.
722 1115
723 $string = $term->special_decode $text 1116 $string = $term->special_decode $text
724 Converts rxvt-unicodes text reprsentation into a perl string. See 1117 Converts rxvt-unicodes text representation into a perl string. See
725 "$term->ROW_t" for details. 1118 "$term->ROW_t" for details.
726 1119
727 $success = $term->grab_button ($button, $modifiermask) 1120 $success = $term->grab_button ($button, $modifiermask[, $window =
1121 $term->vt])
1122 $term->ungrab_button ($button, $modifiermask[, $window = $term->vt])
728 Registers a synchronous button grab. See the XGrabButton manpage. 1123 Register/unregister a synchronous button grab. See the XGrabButton
1124 manpage.
729 1125
730 $success = $term->grab ($eventtime[, $sync]) 1126 $success = $term->grab ($eventtime[, $sync])
731 Calls XGrabPointer and XGrabKeyboard in asynchronous (default) or 1127 Calls XGrabPointer and XGrabKeyboard in asynchronous (default) or
732 synchronous ($sync is true). Also remembers the grab timestampe. 1128 synchronous ($sync is true). Also remembers the grab timestamp.
733 1129
734 $term->allow_events_async 1130 $term->allow_events_async
735 Calls XAllowEvents with AsyncBoth for the most recent grab. 1131 Calls XAllowEvents with AsyncBoth for the most recent grab.
736 1132
737 $term->allow_events_sync 1133 $term->allow_events_sync
744 $term->ungrab 1140 $term->ungrab
745 Calls XUngrab for the most recent grab. Is called automatically on 1141 Calls XUngrab for the most recent grab. Is called automatically on
746 evaluation errors, as it is better to lose the grab in the error 1142 evaluation errors, as it is better to lose the grab in the error
747 case as the session. 1143 case as the session.
748 1144
1145 $atom = $term->XInternAtom ($atom_name[, $only_if_exists])
1146 $atom_name = $term->XGetAtomName ($atom)
1147 @atoms = $term->XListProperties ($window)
1148 ($type,$format,$octets) = $term->XGetWindowProperty ($window, $property)
1149 $term->XChangeWindowProperty ($window, $property, $type, $format,
1150 $octets)
1151 $term->XDeleteProperty ($window, $property)
1152 $window = $term->DefaultRootWindow
1153 $term->XReparentWindow ($window, $parent, [$x, $y])
1154 $term->XMapWindow ($window)
1155 $term->XUnmapWindow ($window)
1156 $term->XMoveResizeWindow ($window, $x, $y, $width, $height)
1157 ($x, $y, $child_window) = $term->XTranslateCoordinates ($src, $dst, $x,
1158 $y)
1159 $term->XChangeInput ($window, $add_events[, $del_events])
1160 Various X or X-related functions. The $term object only serves as
1161 the source of the display, otherwise those functions map
1162 more-or-less directory onto the X functions of the same name.
1163
749 The "urxvt::popup" Class 1164 The "urxvt::popup" Class
750 $popup->add_title ($title) 1165 $popup->add_title ($title)
751 Adds a non-clickable title to the popup. 1166 Adds a non-clickable title to the popup.
752 1167
753 $popup->add_separator ([$sepchr]) 1168 $popup->add_separator ([$sepchr])
756 1171
757 $popup->add_button ($text, $cb) 1172 $popup->add_button ($text, $cb)
758 Adds a clickable button to the popup. $cb is called whenever it is 1173 Adds a clickable button to the popup. $cb is called whenever it is
759 selected. 1174 selected.
760 1175
761 $popup->add_toggle ($text, $cb, $initial_value) 1176 $popup->add_toggle ($text, $initial_value, $cb)
762 Adds a toggle/checkbox item to the popup. Teh callback gets called 1177 Adds a toggle/checkbox item to the popup. The callback gets called
763 whenever it gets toggled, with a boolean indicating its value as its 1178 whenever it gets toggled, with a boolean indicating its new value as
764 first argument. 1179 its first argument.
765 1180
766 $popup->show 1181 $popup->show
767 Displays the popup (which is initially hidden). 1182 Displays the popup (which is initially hidden).
768 1183
769 The "urxvt::timer" Class 1184 The "urxvt::timer" Class
800 $timer = $timer->start 1215 $timer = $timer->start
801 Start the timer. 1216 Start the timer.
802 1217
803 $timer = $timer->start ($tstamp) 1218 $timer = $timer->start ($tstamp)
804 Set the event trigger time to $tstamp and start the timer. 1219 Set the event trigger time to $tstamp and start the timer.
1220
1221 $timer = $timer->after ($delay)
1222 Like "start", but sets the expiry timer to c<urxvt::NOW + $delay>.
805 1223
806 $timer = $timer->stop 1224 $timer = $timer->stop
807 Stop the timer. 1225 Stop the timer.
808 1226
809 The "urxvt::iow" Class 1227 The "urxvt::iow" Class
828 $iow = $iow->cb (sub { my ($iow, $reventmask) = @_; ... }) 1246 $iow = $iow->cb (sub { my ($iow, $reventmask) = @_; ... })
829 Set the callback to be called when io events are triggered. 1247 Set the callback to be called when io events are triggered.
830 $reventmask is a bitset as described in the "events" method. 1248 $reventmask is a bitset as described in the "events" method.
831 1249
832 $iow = $iow->fd ($fd) 1250 $iow = $iow->fd ($fd)
833 Set the filedescriptor (not handle) to watch. 1251 Set the file descriptor (not handle) to watch.
834 1252
835 $iow = $iow->events ($eventmask) 1253 $iow = $iow->events ($eventmask)
836 Set the event mask to watch. The only allowed values are 1254 Set the event mask to watch. The only allowed values are
837 "urxvt::EVENT_READ" and "urxvt::EVENT_WRITE", which might be ORed 1255 "urxvt::EVENT_READ" and "urxvt::EVENT_WRITE", which might be ORed
838 together, or "urxvt::EVENT_NONE". 1256 together, or "urxvt::EVENT_NONE".
839 1257
840 $iow = $iow->start 1258 $iow = $iow->start
841 Start watching for requested events on the given handle. 1259 Start watching for requested events on the given handle.
842 1260
843 $iow = $iow->stop 1261 $iow = $iow->stop
844 Stop watching for events on the given filehandle. 1262 Stop watching for events on the given file handle.
1263
1264 The "urxvt::iw" Class
1265 This class implements idle watchers, that get called automatically when
1266 the process is idle. They should return as fast as possible, after doing
1267 some useful work.
1268
1269 $iw = new urxvt::iw
1270 Create a new idle watcher object in stopped state.
1271
1272 $iw = $iw->cb (sub { my ($iw) = @_; ... })
1273 Set the callback to be called when the watcher triggers.
1274
1275 $timer = $timer->start
1276 Start the watcher.
1277
1278 $timer = $timer->stop
1279 Stop the watcher.
1280
1281 The "urxvt::pw" Class
1282 This class implements process watchers. They create an event whenever a
1283 process exits, after which they stop automatically.
1284
1285 my $pid = fork;
1286 ...
1287 $term->{pw} = urxvt::pw
1288 ->new
1289 ->start ($pid)
1290 ->cb (sub {
1291 my ($pw, $exit_status) = @_;
1292 ...
1293 });
1294
1295 $pw = new urxvt::pw
1296 Create a new process watcher in stopped state.
1297
1298 $pw = $pw->cb (sub { my ($pw, $exit_status) = @_; ... })
1299 Set the callback to be called when the timer triggers.
1300
1301 $pw = $timer->start ($pid)
1302 Tells the watcher to start watching for process $pid.
1303
1304 $pw = $pw->stop
1305 Stop the watcher.
845 1306
846ENVIRONMENT 1307ENVIRONMENT
847 URXVT_PERL_VERBOSITY 1308 URXVT_PERL_VERBOSITY
848 This variable controls the verbosity level of the perl extension. Higher 1309 This variable controls the verbosity level of the perl extension. Higher
849 numbers indicate more verbose output. 1310 numbers indicate more verbose output.
850 1311
851 == 0 - fatal messages 1312 == 0 - fatal messages
852 >= 3 - script loading and management 1313 >= 3 - script loading and management
853 >=10 - all called hooks 1314 >=10 - all called hooks
854 >=11 - hook reutrn values 1315 >=11 - hook return values
855 1316
856AUTHOR 1317AUTHOR
857 Marc Lehmann <pcg@goof.com> 1318 Marc Lehmann <pcg@goof.com>
858 http://software.schmorp.de/pkg/rxvt-unicode 1319 http://software.schmorp.de/pkg/rxvt-unicode
859 1320

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines