… | |
… | |
127 | .\} |
127 | .\} |
128 | .rm #[ #] #H #V #F C |
128 | .rm #[ #] #H #V #F C |
129 | .\" ======================================================================== |
129 | .\" ======================================================================== |
130 | .\" |
130 | .\" |
131 | .IX Title "rxvt 3" |
131 | .IX Title "rxvt 3" |
132 | .TH rxvt 3 "2006-01-19" "7.1" "RXVT-UNICODE" |
132 | .TH rxvt 3 "2006-01-20" "7.1" "RXVT-UNICODE" |
133 | .SH "NAME" |
133 | .SH "NAME" |
134 | @@RXVT_NAME@@perl \- rxvt\-unicode's embedded perl interpreter |
134 | @@RXVT_NAME@@perl \- rxvt\-unicode's embedded perl interpreter |
135 | .SH "SYNOPSIS" |
135 | .SH "SYNOPSIS" |
136 | .IX Header "SYNOPSIS" |
136 | .IX Header "SYNOPSIS" |
137 | .Vb 1 |
137 | .Vb 1 |
… | |
… | |
169 | .PP |
169 | .PP |
170 | You can activate them like this: |
170 | You can activate them like this: |
171 | .PP |
171 | .PP |
172 | .Vb 1 |
172 | .Vb 1 |
173 | \& @@RXVT_NAME@@ -pe <extensionname> |
173 | \& @@RXVT_NAME@@ -pe <extensionname> |
|
|
174 | .Ve |
|
|
175 | .PP |
|
|
176 | Or by adding them to the resource for extensions loaded by default: |
|
|
177 | .PP |
|
|
178 | .Vb 1 |
|
|
179 | \& URxvt.perl-ext-common: default,automove-background,selection-autotransform |
174 | .Ve |
180 | .Ve |
175 | .IP "selection (enabled by default)" 4 |
181 | .IP "selection (enabled by default)" 4 |
176 | .IX Item "selection (enabled by default)" |
182 | .IX Item "selection (enabled by default)" |
177 | (More) intelligent selection. This extension tries to be more intelligent |
183 | (More) intelligent selection. This extension tries to be more intelligent |
178 | when the user extends selections (double\-click and further clicks). Right |
184 | when the user extends selections (double\-click and further clicks). Right |
… | |
… | |
301 | .Ve |
307 | .Ve |
302 | .Sp |
308 | .Sp |
303 | The first line tells the selection code to treat the unchanging part of |
309 | The first line tells the selection code to treat the unchanging part of |
304 | every error message as a selection pattern, and the second line transforms |
310 | every error message as a selection pattern, and the second line transforms |
305 | the message into vi commands to load the file. |
311 | the message into vi commands to load the file. |
|
|
312 | .IP "tabbed" 4 |
|
|
313 | .IX Item "tabbed" |
|
|
314 | This transforms the terminal into a tabbar with additional terminals, that |
|
|
315 | is, it implements what is commonly refered to as \*(L"tabbed terminal\*(R". The topmost line |
|
|
316 | displays a \*(L"[\s-1NEW\s0]\*(R" button, which, when clicked, will add a new tab, followed by one |
|
|
317 | button per tab. |
|
|
318 | .Sp |
|
|
319 | Clicking a button will activate that tab. Pressing Shift-Left and |
|
|
320 | Shift-Right will switch to the tab left or right of the current one. |
306 | .IP "mark-urls" 4 |
321 | .IP "mark-urls" 4 |
307 | .IX Item "mark-urls" |
322 | .IX Item "mark-urls" |
308 | Uses per-line display filtering (\f(CW\*(C`on_line_update\*(C'\fR) to underline urls and |
323 | Uses per-line display filtering (\f(CW\*(C`on_line_update\*(C'\fR) to underline urls and |
309 | make them clickable. When middle\-clicked, the program specified in the |
324 | make them clickable. When middle\-clicked, the program specified in the |
310 | resource \f(CW\*(C`urlLauncher\*(C'\fR (default \f(CW\*(C`x\-www\-browser\*(C'\fR) will be started with |
325 | resource \f(CW\*(C`urlLauncher\*(C'\fR (default \f(CW\*(C`x\-www\-browser\*(C'\fR) will be started with |
… | |
… | |
429 | called whenever the relevant event happens. |
444 | called whenever the relevant event happens. |
430 | .PP |
445 | .PP |
431 | The first argument passed to them is an extension oject as described in |
446 | The first argument passed to them is an extension oject as described in |
432 | the in the \f(CW\*(C`Extension Objects\*(C'\fR section. |
447 | the in the \f(CW\*(C`Extension Objects\*(C'\fR section. |
433 | .PP |
448 | .PP |
434 | \&\fBAll\fR of these hooks must return a boolean value. If it is true, then the |
449 | \&\fBAll\fR of these hooks must return a boolean value. If any of the called |
435 | event counts as being \fIconsumed\fR, and the invocation of other hooks is |
450 | hooks returns true, then the event counts as being \fIconsumed\fR, and the |
436 | skipped, and the relevant action might not be carried out by the \*(C+ code. |
451 | relevant action might not be carried out by the \*(C+ code. |
437 | .PP |
452 | .PP |
438 | \&\fIWhen in doubt, return a false value (preferably \f(CI\*(C`()\*(C'\fI).\fR |
453 | \&\fIWhen in doubt, return a false value (preferably \f(CI\*(C`()\*(C'\fI).\fR |
439 | .ie n .IP "on_init $term" 4 |
454 | .ie n .IP "on_init $term" 4 |
440 | .el .IP "on_init \f(CW$term\fR" 4 |
455 | .el .IP "on_init \f(CW$term\fR" 4 |
441 | .IX Item "on_init $term" |
456 | .IX Item "on_init $term" |
442 | Called after a new terminal object has been initialized, but before |
457 | Called after a new terminal object has been initialized, but before |
443 | windows are created or the command gets run. Most methods are unsafe to |
458 | windows are created or the command gets run. Most methods are unsafe to |
444 | call or deliver senseless data, as terminal size and other characteristics |
459 | call or deliver senseless data, as terminal size and other characteristics |
445 | have not yet been determined. You can safely query and change resources, |
460 | have not yet been determined. You can safely query and change resources |
446 | though. |
461 | and options, though. For many purposes the \f(CW\*(C`on_start\*(C'\fR hook is a better |
|
|
462 | place. |
|
|
463 | .ie n .IP "on_start $term" 4 |
|
|
464 | .el .IP "on_start \f(CW$term\fR" 4 |
|
|
465 | .IX Item "on_start $term" |
|
|
466 | Called at the very end of initialisation of a new terminal, just before |
|
|
467 | trying to map (display) the toplevel and returning to the mainloop. |
|
|
468 | .ie n .IP "on_destroy $term" 4 |
|
|
469 | .el .IP "on_destroy \f(CW$term\fR" 4 |
|
|
470 | .IX Item "on_destroy $term" |
|
|
471 | Called whenever something tries to destroy terminal, before doing anything |
|
|
472 | yet. If this hook returns true, then destruction is skipped, but this is |
|
|
473 | rarely a good idea. |
447 | .ie n .IP "on_reset $term" 4 |
474 | .ie n .IP "on_reset $term" 4 |
448 | .el .IP "on_reset \f(CW$term\fR" 4 |
475 | .el .IP "on_reset \f(CW$term\fR" 4 |
449 | .IX Item "on_reset $term" |
476 | .IX Item "on_reset $term" |
450 | Called after the screen is \*(L"reset\*(R" for any reason, such as resizing or |
477 | Called after the screen is \*(L"reset\*(R" for any reason, such as resizing or |
451 | control sequences. Here is where you can react on changes to size-related |
478 | control sequences. Here is where you can react on changes to size-related |
452 | variables. |
479 | variables. |
453 | .ie n .IP "on_start $term" 4 |
|
|
454 | .el .IP "on_start \f(CW$term\fR" 4 |
|
|
455 | .IX Item "on_start $term" |
|
|
456 | Called at the very end of initialisation of a new terminal, just before |
|
|
457 | returning to the mainloop. |
|
|
458 | .ie n .IP "on_child_start $term\fR, \f(CW$pid" 4 |
480 | .ie n .IP "on_child_start $term\fR, \f(CW$pid" 4 |
459 | .el .IP "on_child_start \f(CW$term\fR, \f(CW$pid\fR" 4 |
481 | .el .IP "on_child_start \f(CW$term\fR, \f(CW$pid\fR" 4 |
460 | .IX Item "on_child_start $term, $pid" |
482 | .IX Item "on_child_start $term, $pid" |
461 | Called just after the child process has been \f(CW\*(C`fork\*(C'\fRed. |
483 | Called just after the child process has been \f(CW\*(C`fork\*(C'\fRed. |
462 | .ie n .IP "on_child_exit $term\fR, \f(CW$status" 4 |
484 | .ie n .IP "on_child_exit $term\fR, \f(CW$status" 4 |
… | |
… | |
616 | .Sp |
638 | .Sp |
617 | \&\f(CW\*(C`on_key_press\*(C'\fR additionally receives the string rxvt-unicode would |
639 | \&\f(CW\*(C`on_key_press\*(C'\fR additionally receives the string rxvt-unicode would |
618 | output, if any, in locale-specific encoding. |
640 | output, if any, in locale-specific encoding. |
619 | .Sp |
641 | .Sp |
620 | subwindow. |
642 | subwindow. |
|
|
643 | .ie n .IP "on_client_message $term\fR, \f(CW$event" 4 |
|
|
644 | .el .IP "on_client_message \f(CW$term\fR, \f(CW$event\fR" 4 |
|
|
645 | .IX Item "on_client_message $term, $event" |
|
|
646 | .PD 0 |
|
|
647 | .ie n .IP "on_wm_protocols $term\fR, \f(CW$event" 4 |
|
|
648 | .el .IP "on_wm_protocols \f(CW$term\fR, \f(CW$event\fR" 4 |
|
|
649 | .IX Item "on_wm_protocols $term, $event" |
|
|
650 | .ie n .IP "on_wm_delete_window $term\fR, \f(CW$event" 4 |
|
|
651 | .el .IP "on_wm_delete_window \f(CW$term\fR, \f(CW$event\fR" 4 |
|
|
652 | .IX Item "on_wm_delete_window $term, $event" |
|
|
653 | .PD |
|
|
654 | Called when various types of ClientMessage events are received (all with |
|
|
655 | format=32, \s-1WM_PROTOCOLS\s0 or \s-1WM_PROTOCOLS:WM_DELETE_WINDOW\s0). |
621 | .ie n .Sh "Variables in the ""urxvt"" Package" |
656 | .ie n .Sh "Variables in the ""urxvt"" Package" |
622 | .el .Sh "Variables in the \f(CWurxvt\fP Package" |
657 | .el .Sh "Variables in the \f(CWurxvt\fP Package" |
623 | .IX Subsection "Variables in the urxvt Package" |
658 | .IX Subsection "Variables in the urxvt Package" |
624 | .IP "$urxvt::LIBDIR" 4 |
659 | .IP "$urxvt::LIBDIR" 4 |
625 | .IX Item "$urxvt::LIBDIR" |
660 | .IX Item "$urxvt::LIBDIR" |
… | |
… | |
634 | The basename of the installed binaries, usually \f(CW\*(C`urxvt\*(C'\fR. |
669 | The basename of the installed binaries, usually \f(CW\*(C`urxvt\*(C'\fR. |
635 | .IP "$urxvt::TERM" 4 |
670 | .IP "$urxvt::TERM" 4 |
636 | .IX Item "$urxvt::TERM" |
671 | .IX Item "$urxvt::TERM" |
637 | The current terminal. This variable stores the current \f(CW\*(C`urxvt::term\*(C'\fR |
672 | The current terminal. This variable stores the current \f(CW\*(C`urxvt::term\*(C'\fR |
638 | object, whenever a callback/hook is executing. |
673 | object, whenever a callback/hook is executing. |
|
|
674 | .IP "@urxvt::TERM_INIT" 4 |
|
|
675 | .IX Item "@urxvt::TERM_INIT" |
|
|
676 | All coderefs in this array will be called as methods of the next newly |
|
|
677 | created \f(CW\*(C`urxvt::term\*(C'\fR object (during the \f(CW\*(C`on_init\*(C'\fR phase). The array |
|
|
678 | gets cleared before the codereferences that were in it are being executed, |
|
|
679 | so coderefs can push themselves onto it again if they so desire. |
|
|
680 | .Sp |
|
|
681 | This complements to the perl-eval commandline option, but gets executed |
|
|
682 | first. |
|
|
683 | .IP "@urxvt::TERM_EXT" 4 |
|
|
684 | .IX Item "@urxvt::TERM_EXT" |
|
|
685 | Works similar to \f(CW@TERM_INIT\fR, but contains perl package/class names, which |
|
|
686 | get registered as normal extensions after calling the hooks in \f(CW@TERM_INIT\fR |
|
|
687 | but before other extensions. Gets cleared just like \f(CW@TERM_INIT\fR. |
639 | .ie n .Sh "Functions in the ""urxvt"" Package" |
688 | .ie n .Sh "Functions in the ""urxvt"" Package" |
640 | .el .Sh "Functions in the \f(CWurxvt\fP Package" |
689 | .el .Sh "Functions in the \f(CWurxvt\fP Package" |
641 | .IX Subsection "Functions in the urxvt Package" |
690 | .IX Subsection "Functions in the urxvt Package" |
642 | .ie n .IP "urxvt::fatal $errormessage" 4 |
691 | .ie n .IP "urxvt::fatal $errormessage" 4 |
643 | .el .IP "urxvt::fatal \f(CW$errormessage\fR" 4 |
692 | .el .IP "urxvt::fatal \f(CW$errormessage\fR" 4 |
… | |
… | |
1306 | Start watching for requested events on the given handle. |
1355 | Start watching for requested events on the given handle. |
1307 | .ie n .IP "$iow = $iow\->stop" 4 |
1356 | .ie n .IP "$iow = $iow\->stop" 4 |
1308 | .el .IP "$iow = \f(CW$iow\fR\->stop" 4 |
1357 | .el .IP "$iow = \f(CW$iow\fR\->stop" 4 |
1309 | .IX Item "$iow = $iow->stop" |
1358 | .IX Item "$iow = $iow->stop" |
1310 | Stop watching for events on the given filehandle. |
1359 | Stop watching for events on the given filehandle. |
|
|
1360 | .ie n .Sh "The ""urxvt::iw"" Class" |
|
|
1361 | .el .Sh "The \f(CWurxvt::iw\fP Class" |
|
|
1362 | .IX Subsection "The urxvt::iw Class" |
|
|
1363 | This class implements idle watchers, that get called automatically when |
|
|
1364 | the process is idle. They should return as fast as possible, after doing |
|
|
1365 | some useful work. |
|
|
1366 | .IP "$iw = new urxvt::iw" 4 |
|
|
1367 | .IX Item "$iw = new urxvt::iw" |
|
|
1368 | Create a new idle watcher object in stopped state. |
|
|
1369 | .ie n .IP "$iw = $iw\fR\->cb (sub { my ($iw) = \f(CW@_; ... })" 4 |
|
|
1370 | .el .IP "$iw = \f(CW$iw\fR\->cb (sub { my ($iw) = \f(CW@_\fR; ... })" 4 |
|
|
1371 | .IX Item "$iw = $iw->cb (sub { my ($iw) = @_; ... })" |
|
|
1372 | Set the callback to be called when the watcher triggers. |
|
|
1373 | .ie n .IP "$timer = $timer\->start" 4 |
|
|
1374 | .el .IP "$timer = \f(CW$timer\fR\->start" 4 |
|
|
1375 | .IX Item "$timer = $timer->start" |
|
|
1376 | Start the watcher. |
|
|
1377 | .ie n .IP "$timer = $timer\->stop" 4 |
|
|
1378 | .el .IP "$timer = \f(CW$timer\fR\->stop" 4 |
|
|
1379 | .IX Item "$timer = $timer->stop" |
|
|
1380 | Stop the watcher. |
|
|
1381 | .ie n .Sh "The ""urxvt::pw"" Class" |
|
|
1382 | .el .Sh "The \f(CWurxvt::pw\fP Class" |
|
|
1383 | .IX Subsection "The urxvt::pw Class" |
|
|
1384 | This class implements process watchers. They create an event whenever a |
|
|
1385 | process exits, after which they stop automatically. |
|
|
1386 | .PP |
|
|
1387 | .Vb 9 |
|
|
1388 | \& my $pid = fork; |
|
|
1389 | \& ... |
|
|
1390 | \& $term->{pw} = urxvt::pw |
|
|
1391 | \& ->new |
|
|
1392 | \& ->start ($pid) |
|
|
1393 | \& ->cb (sub { |
|
|
1394 | \& my ($pw, $exit_status) = @_; |
|
|
1395 | \& ... |
|
|
1396 | \& }); |
|
|
1397 | .Ve |
|
|
1398 | .IP "$pw = new urxvt::pw" 4 |
|
|
1399 | .IX Item "$pw = new urxvt::pw" |
|
|
1400 | Create a new process watcher in stopped state. |
|
|
1401 | .ie n .IP "$pw = $pw\fR\->cb (sub { my ($pw, \f(CW$exit_status\fR) = \f(CW@_; ... })" 4 |
|
|
1402 | .el .IP "$pw = \f(CW$pw\fR\->cb (sub { my ($pw, \f(CW$exit_status\fR) = \f(CW@_\fR; ... })" 4 |
|
|
1403 | .IX Item "$pw = $pw->cb (sub { my ($pw, $exit_status) = @_; ... })" |
|
|
1404 | Set the callback to be called when the timer triggers. |
|
|
1405 | .ie n .IP "$pw = $timer\->start ($pid)" 4 |
|
|
1406 | .el .IP "$pw = \f(CW$timer\fR\->start ($pid)" 4 |
|
|
1407 | .IX Item "$pw = $timer->start ($pid)" |
|
|
1408 | Tells the wqtcher to start watching for process \f(CW$pid\fR. |
|
|
1409 | .ie n .IP "$pw = $pw\->stop" 4 |
|
|
1410 | .el .IP "$pw = \f(CW$pw\fR\->stop" 4 |
|
|
1411 | .IX Item "$pw = $pw->stop" |
|
|
1412 | Stop the watcher. |
1311 | .SH "ENVIRONMENT" |
1413 | .SH "ENVIRONMENT" |
1312 | .IX Header "ENVIRONMENT" |
1414 | .IX Header "ENVIRONMENT" |
1313 | .Sh "\s-1URXVT_PERL_VERBOSITY\s0" |
1415 | .Sh "\s-1URXVT_PERL_VERBOSITY\s0" |
1314 | .IX Subsection "URXVT_PERL_VERBOSITY" |
1416 | .IX Subsection "URXVT_PERL_VERBOSITY" |
1315 | This variable controls the verbosity level of the perl extension. Higher |
1417 | This variable controls the verbosity level of the perl extension. Higher |