… | |
… | |
172 | .Vb 1 |
172 | .Vb 1 |
173 | \& @@RXVT_NAME@@ -pe <extensionname> |
173 | \& @@RXVT_NAME@@ -pe <extensionname> |
174 | .Ve |
174 | .Ve |
175 | .IP "selection" 4 |
175 | .IP "selection" 4 |
176 | .IX Item "selection" |
176 | .IX Item "selection" |
177 | Miscellaneous selection modifications. |
177 | Intelligent selection. This etxension tries to be more intelligent when the user |
|
|
178 | extends selections (double\-click). |
|
|
179 | .Sp |
|
|
180 | It also offers the following bindable event: |
178 | .RS 4 |
181 | .RS 4 |
179 | .IP "rot13" 4 |
182 | .IP "rot13" 4 |
180 | .IX Item "rot13" |
183 | .IX Item "rot13" |
181 | Rot\-13 the selection when activated. Used via keyboard trigger: |
184 | Rot\-13 the selection when activated. Used via keyboard trigger: |
182 | .Sp |
185 | .Sp |
… | |
… | |
197 | .Sh "General \s-1API\s0 Considerations" |
200 | .Sh "General \s-1API\s0 Considerations" |
198 | .IX Subsection "General API Considerations" |
201 | .IX Subsection "General API Considerations" |
199 | All objects (such as terminals, time watchers etc.) are typical |
202 | All objects (such as terminals, time watchers etc.) are typical |
200 | reference-to-hash objects. The hash can be used to store anything you |
203 | reference-to-hash objects. The hash can be used to store anything you |
201 | like. All members starting with an underscore (such as \f(CW\*(C`_ptr\*(C'\fR or |
204 | like. All members starting with an underscore (such as \f(CW\*(C`_ptr\*(C'\fR or |
202 | \&\f(CW\*(C`_hook\*(C'\fR) are reserved for internal uses and must not be accessed or |
205 | \&\f(CW\*(C`_hook\*(C'\fR) are reserved for internal uses and \fB\s-1MUST\s0 \s-1NOT\s0\fR be accessed or |
203 | modified). |
206 | modified). |
204 | .PP |
207 | .PP |
205 | When objects are destroyed on the \*(C+ side, the perl object hashes are |
208 | When objects are destroyed on the \*(C+ side, the perl object hashes are |
206 | emptied, so its best to store related objects such as time watchers and |
209 | emptied, so its best to store related objects such as time watchers and |
207 | the like inside the terminal object so they get destroyed as soon as the |
210 | the like inside the terminal object so they get destroyed as soon as the |
208 | terminal is destroyed. |
211 | terminal is destroyed. |
209 | .Sh "Hooks" |
212 | .Sh "Hooks" |
210 | .IX Subsection "Hooks" |
213 | .IX Subsection "Hooks" |
211 | The following subroutines can be declared in loaded scripts, and will be called |
214 | The following subroutines can be declared in loaded scripts, and will be |
212 | whenever the relevant event happens. |
215 | called whenever the relevant event happens. |
|
|
216 | .PP |
|
|
217 | The first argument passed to them is an object private to each terminal |
|
|
218 | and extension package. You can call all \f(CW\*(C`urxvt::term\*(C'\fR methods on it, but |
|
|
219 | its not a real \f(CW\*(C`urxvt::term\*(C'\fR object. Instead, the real \f(CW\*(C`urxvt::term\*(C'\fR |
|
|
220 | object that is shared between all packages is stored in the \f(CW\*(C`term\*(C'\fR |
|
|
221 | member. |
213 | .PP |
222 | .PP |
214 | All of them must return a boolean value. If it is true, then the event |
223 | All of them must return a boolean value. If it is true, then the event |
215 | counts as being \fIconsumed\fR, and the invocation of other hooks is skipped, |
224 | counts as being \fIconsumed\fR, and the invocation of other hooks is skipped, |
216 | and the relevant action might not be carried out by the \*(C+ code. |
225 | and the relevant action might not be carried out by the \*(C+ code. |
217 | .PP |
226 | .PP |
… | |
… | |
247 | Called whenever a selection has been copied, but before the selection is |
256 | Called whenever a selection has been copied, but before the selection is |
248 | requested from the server. The selection text can be queried and changed |
257 | requested from the server. The selection text can be queried and changed |
249 | by calling \f(CW\*(C`$term\->selection\*(C'\fR. |
258 | by calling \f(CW\*(C`$term\->selection\*(C'\fR. |
250 | .Sp |
259 | .Sp |
251 | Returning a true value aborts selection grabbing. It will still be hilighted. |
260 | Returning a true value aborts selection grabbing. It will still be hilighted. |
|
|
261 | .ie n .IP "on_sel_extend $term" 4 |
|
|
262 | .el .IP "on_sel_extend \f(CW$term\fR" 4 |
|
|
263 | .IX Item "on_sel_extend $term" |
|
|
264 | Called whenever the user tries to extend the selection (e.g. with a double |
|
|
265 | click) and is either supposed to return false (normal operation), or |
|
|
266 | should extend the selection itelf and return true to suppress the built-in |
|
|
267 | processing. |
|
|
268 | .Sp |
|
|
269 | See the \fIselection\fR example extension. |
252 | .ie n .IP "on_focus_in $term" 4 |
270 | .ie n .IP "on_focus_in $term" 4 |
253 | .el .IP "on_focus_in \f(CW$term\fR" 4 |
271 | .el .IP "on_focus_in \f(CW$term\fR" 4 |
254 | .IX Item "on_focus_in $term" |
272 | .IX Item "on_focus_in $term" |
255 | Called whenever the window gets the keyboard focus, before urxvt does |
273 | Called whenever the window gets the keyboard focus, before urxvt does |
256 | focus in processing. |
274 | focus in processing. |
… | |
… | |
294 | .el .IP "on_keyboard_command \f(CW$term\fR, \f(CW$string\fR" 4 |
312 | .el .IP "on_keyboard_command \f(CW$term\fR, \f(CW$string\fR" 4 |
295 | .IX Item "on_keyboard_command $term, $string" |
313 | .IX Item "on_keyboard_command $term, $string" |
296 | Called whenever the user presses a key combination that has a |
314 | Called whenever the user presses a key combination that has a |
297 | \&\f(CW\*(C`perl:string\*(C'\fR action bound to it (see description of the \fBkeysym\fR |
315 | \&\f(CW\*(C`perl:string\*(C'\fR action bound to it (see description of the \fBkeysym\fR |
298 | resource in the @@RXVT_NAME@@(1) manpage). |
316 | resource in the @@RXVT_NAME@@(1) manpage). |
|
|
317 | .ie n .Sh "Variables in the ""urxvt"" Package" |
|
|
318 | .el .Sh "Variables in the \f(CWurxvt\fP Package" |
|
|
319 | .IX Subsection "Variables in the urxvt Package" |
|
|
320 | .IP "$urxvt::TERM" 4 |
|
|
321 | .IX Item "$urxvt::TERM" |
|
|
322 | The current terminal. Whenever a callback/Hook is bein executed, this |
|
|
323 | variable stores the current \f(CW\*(C`urxvt::term\*(C'\fR object. |
299 | .ie n .Sh "Functions in the ""urxvt"" Package" |
324 | .ie n .Sh "Functions in the ""urxvt"" Package" |
300 | .el .Sh "Functions in the \f(CWurxvt\fP Package" |
325 | .el .Sh "Functions in the \f(CWurxvt\fP Package" |
301 | .IX Subsection "Functions in the urxvt Package" |
326 | .IX Subsection "Functions in the urxvt Package" |
302 | .ie n .IP "urxvt::fatal $errormessage" 4 |
327 | .ie n .IP "urxvt::fatal $errormessage" 4 |
303 | .el .IP "urxvt::fatal \f(CW$errormessage\fR" 4 |
328 | .el .IP "urxvt::fatal \f(CW$errormessage\fR" 4 |
… | |
… | |
468 | right/bottom side, respectively. |
493 | right/bottom side, respectively. |
469 | .Sp |
494 | .Sp |
470 | This method returns an urxvt::overlay object. The overlay will be visible |
495 | This method returns an urxvt::overlay object. The overlay will be visible |
471 | as long as the perl object is referenced. |
496 | as long as the perl object is referenced. |
472 | .Sp |
497 | .Sp |
473 | Currently, the only method on the \f(CW\*(C`urxvt::overlay\*(C'\fR object is \f(CW\*(C`set\*(C'\fR: |
498 | The methods currently supported on \f(CW\*(C`urxvt::overlay\*(C'\fR objects are: |
|
|
499 | .RS 4 |
474 | .ie n .IP "$overlay\->set ($x, $y\fR, \f(CW$text\fR, \f(CW$rend)" 4 |
500 | .ie n .IP "$overlay\->set ($x, $y\fR, \f(CW$text\fR, \f(CW$rend)" 4 |
475 | .el .IP "$overlay\->set ($x, \f(CW$y\fR, \f(CW$text\fR, \f(CW$rend\fR)" 4 |
501 | .el .IP "$overlay\->set ($x, \f(CW$y\fR, \f(CW$text\fR, \f(CW$rend\fR)" 4 |
476 | .IX Item "$overlay->set ($x, $y, $text, $rend)" |
502 | .IX Item "$overlay->set ($x, $y, $text, $rend)" |
477 | Similar to \f(CW\*(C`$term\->ROW_t\*(C'\fR and \f(CW\*(C`$term\->ROW_r\*(C'\fR in that it puts |
503 | Similar to \f(CW\*(C`$term\->ROW_t\*(C'\fR and \f(CW\*(C`$term\->ROW_r\*(C'\fR in that it puts |
478 | text in rxvt\-unicode's special encoding and an array of rendition values |
504 | text in rxvt\-unicode's special encoding and an array of rendition values |
479 | at a specific position inside the overlay. |
505 | at a specific position inside the overlay. |
|
|
506 | .IP "$overlay\->hide" 4 |
|
|
507 | .IX Item "$overlay->hide" |
|
|
508 | If visible, hide the overlay, but do not destroy it. |
|
|
509 | .IP "$overlay\->show" 4 |
|
|
510 | .IX Item "$overlay->show" |
|
|
511 | If hidden, display the overlay again. |
|
|
512 | .RE |
|
|
513 | .RS 4 |
|
|
514 | .RE |
480 | .ie n .IP "$cellwidth = $term\fR\->strwidth \f(CW$string" 4 |
515 | .ie n .IP "$cellwidth = $term\fR\->strwidth \f(CW$string" 4 |
481 | .el .IP "$cellwidth = \f(CW$term\fR\->strwidth \f(CW$string\fR" 4 |
516 | .el .IP "$cellwidth = \f(CW$term\fR\->strwidth \f(CW$string\fR" 4 |
482 | .IX Item "$cellwidth = $term->strwidth $string" |
517 | .IX Item "$cellwidth = $term->strwidth $string" |
483 | Returns the number of screen-cells this string would need. Correctly |
518 | Returns the number of screen-cells this string would need. Correctly |
484 | accounts for wide and combining characters. |
519 | accounts for wide and combining characters. |
… | |
… | |
526 | .el .IP "$text = \f(CW$term\fR\->ROW_t ($row_number[, \f(CW$new_text\fR[, \f(CW$start_col\fR]])" 4 |
561 | .el .IP "$text = \f(CW$term\fR\->ROW_t ($row_number[, \f(CW$new_text\fR[, \f(CW$start_col\fR]])" 4 |
527 | .IX Item "$text = $term->ROW_t ($row_number[, $new_text[, $start_col]])" |
562 | .IX Item "$text = $term->ROW_t ($row_number[, $new_text[, $start_col]])" |
528 | Returns the text of the entire row with number \f(CW$row_number\fR. Row \f(CW0\fR |
563 | Returns the text of the entire row with number \f(CW$row_number\fR. Row \f(CW0\fR |
529 | is the topmost terminal line, row \f(CW\*(C`$term\->$ncol\-1\*(C'\fR is the bottommost |
564 | is the topmost terminal line, row \f(CW\*(C`$term\->$ncol\-1\*(C'\fR is the bottommost |
530 | terminal line. The scrollback buffer starts at line \f(CW\*(C`\-1\*(C'\fR and extends to |
565 | terminal line. The scrollback buffer starts at line \f(CW\*(C`\-1\*(C'\fR and extends to |
531 | line \f(CW\*(C`\-$term\->nsaved\*(C'\fR. |
566 | line \f(CW\*(C`\-$term\->nsaved\*(C'\fR. Nothing will be returned if a nonexistent line |
|
|
567 | is requested. |
532 | .Sp |
568 | .Sp |
533 | If \f(CW$new_text\fR is specified, it will replace characters in the current |
569 | If \f(CW$new_text\fR is specified, it will replace characters in the current |
534 | line, starting at column \f(CW$start_col\fR (default \f(CW0\fR), which is useful |
570 | line, starting at column \f(CW$start_col\fR (default \f(CW0\fR), which is useful |
535 | to replace only parts of a line. The font index in the rendition will |
571 | to replace only parts of a line. The font index in the rendition will |
536 | automatically be updated. |
572 | automatically be updated. |
… | |
… | |
558 | .Sp |
594 | .Sp |
559 | See the section on \s-1RENDITION\s0, above. |
595 | See the section on \s-1RENDITION\s0, above. |
560 | .ie n .IP "$length = $term\fR\->ROW_l ($row_number[, \f(CW$new_length])" 4 |
596 | .ie n .IP "$length = $term\fR\->ROW_l ($row_number[, \f(CW$new_length])" 4 |
561 | .el .IP "$length = \f(CW$term\fR\->ROW_l ($row_number[, \f(CW$new_length\fR])" 4 |
597 | .el .IP "$length = \f(CW$term\fR\->ROW_l ($row_number[, \f(CW$new_length\fR])" 4 |
562 | .IX Item "$length = $term->ROW_l ($row_number[, $new_length])" |
598 | .IX Item "$length = $term->ROW_l ($row_number[, $new_length])" |
563 | Returns the number of screen cells that are in use (\*(L"the line length\*(R"). If |
599 | Returns the number of screen cells that are in use (\*(L"the line |
564 | it is \f(CW\*(C`\-1\*(C'\fR, then the line is part of a multiple-row logical \*(L"line\*(R", which |
600 | length\*(R"). Unlike the urxvt core, this returns \f(CW\*(C`$term\->ncol\*(C'\fR if the |
565 | means all characters are in use and it is continued on the next row. |
601 | line is joined with the following one. |
566 | .ie n .IP "$text = $term\fR\->special_encode \f(CW$string" 4 |
602 | .ie n .IP "$bool = $term\->is_longer ($row_number)" 4 |
567 | .el .IP "$text = \f(CW$term\fR\->special_encode \f(CW$string\fR" 4 |
603 | .el .IP "$bool = \f(CW$term\fR\->is_longer ($row_number)" 4 |
568 | .IX Item "$text = $term->special_encode $string" |
604 | .IX Item "$bool = $term->is_longer ($row_number)" |
|
|
605 | Returns true if the row is part of a multiple-row logical \*(L"line\*(R" (i.e. |
|
|
606 | joined with the following row), which means all characters are in use |
|
|
607 | and it is continued on the next row (and possibly a continuation of the |
|
|
608 | previous row(s)). |
|
|
609 | .ie n .IP "$line = $term\->line ($row_number)" 4 |
|
|
610 | .el .IP "$line = \f(CW$term\fR\->line ($row_number)" 4 |
|
|
611 | .IX Item "$line = $term->line ($row_number)" |
|
|
612 | Create and return a new \f(CW\*(C`urxvt::line\*(C'\fR object that stores information |
|
|
613 | about the logical line that row \f(CW$row_number\fR is part of. It supports the |
|
|
614 | following methods: |
|
|
615 | .RS 4 |
|
|
616 | .ie n .IP "$text = $line\->t" 4 |
|
|
617 | .el .IP "$text = \f(CW$line\fR\->t" 4 |
|
|
618 | .IX Item "$text = $line->t" |
|
|
619 | Returns the full text of the line, similar to \f(CW\*(C`ROW_t\*(C'\fR |
|
|
620 | .ie n .IP "$rend = $line\->r" 4 |
|
|
621 | .el .IP "$rend = \f(CW$line\fR\->r" 4 |
|
|
622 | .IX Item "$rend = $line->r" |
|
|
623 | Returns the full rendition array of the line, similar to \f(CW\*(C`ROW_r\*(C'\fR |
|
|
624 | .ie n .IP "$length = $line\->l" 4 |
|
|
625 | .el .IP "$length = \f(CW$line\fR\->l" 4 |
|
|
626 | .IX Item "$length = $line->l" |
|
|
627 | Returns the length of the line in cells, similar to \f(CW\*(C`ROW_l\*(C'\fR. |
|
|
628 | .ie n .IP "$rownum = $line\->beg" 4 |
|
|
629 | .el .IP "$rownum = \f(CW$line\fR\->beg" 4 |
|
|
630 | .IX Item "$rownum = $line->beg" |
|
|
631 | .PD 0 |
|
|
632 | .ie n .IP "$rownum = $line\->end" 4 |
|
|
633 | .el .IP "$rownum = \f(CW$line\fR\->end" 4 |
|
|
634 | .IX Item "$rownum = $line->end" |
|
|
635 | .PD |
|
|
636 | Return the row number of the first/last row of the line, respectively. |
|
|
637 | .ie n .IP "$offset = $line\fR\->offset_of ($row, \f(CW$col)" 4 |
|
|
638 | .el .IP "$offset = \f(CW$line\fR\->offset_of ($row, \f(CW$col\fR)" 4 |
|
|
639 | .IX Item "$offset = $line->offset_of ($row, $col)" |
|
|
640 | Returns the character offset of the given row|col pair within the logical |
|
|
641 | line. |
|
|
642 | .ie n .IP "($row, $col\fR) = \f(CW$line\->coord_of ($offset)" 4 |
|
|
643 | .el .IP "($row, \f(CW$col\fR) = \f(CW$line\fR\->coord_of ($offset)" 4 |
|
|
644 | .IX Item "($row, $col) = $line->coord_of ($offset)" |
|
|
645 | Translates a string offset into terminal coordinates again. |
|
|
646 | .RE |
|
|
647 | .RS 4 |
|
|
648 | .RE |
|
|
649 | .ie n .IP "($row, $col\fR) = \f(CW$line\fR\->coord_of ($offset) =item \f(CW$text\fR = \f(CW$term\fR\->special_encode \f(CW$string" 4 |
|
|
650 | .el .IP "($row, \f(CW$col\fR) = \f(CW$line\fR\->coord_of ($offset) =item \f(CW$text\fR = \f(CW$term\fR\->special_encode \f(CW$string\fR" 4 |
|
|
651 | .IX Item "($row, $col) = $line->coord_of ($offset) =item $text = $term->special_encode $string" |
569 | Converts a perl string into the special encoding used by rxvt\-unicode, |
652 | Converts a perl string into the special encoding used by rxvt\-unicode, |
570 | where one character corresponds to one screen cell. See |
653 | where one character corresponds to one screen cell. See |
571 | \&\f(CW\*(C`$term\->ROW_t\*(C'\fR for details. |
654 | \&\f(CW\*(C`$term\->ROW_t\*(C'\fR for details. |
572 | .ie n .IP "$string = $term\fR\->special_decode \f(CW$text" 4 |
655 | .ie n .IP "$string = $term\fR\->special_decode \f(CW$text" 4 |
573 | .el .IP "$string = \f(CW$term\fR\->special_decode \f(CW$text\fR" 4 |
656 | .el .IP "$string = \f(CW$term\fR\->special_decode \f(CW$text\fR" 4 |