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.6 by root, Tue Jan 3 04:20:37 2006 UTC vs.
Revision 1.10 by root, Wed Jan 4 05:35:34 2006 UTC

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 33
34 selection 34 selection
35 Miscellaneous selection modifications. 35 Intelligent selection. This extension tries to be more intelligent
36 when the user extends selections (double-click). Right now, it tries
37 to select urls and complete shell-quoted arguments, which is very
38 convenient, too, if your ls supports "--quoting-style=shell".
39
40 It also offers the following bindable event:
36 41
37 rot13 42 rot13
38 Rot-13 the selection when activated. Used via keyboard trigger: 43 Rot-13 the selection when activated. Used via keyboard trigger:
39 44
40 URxvt.keysym.C-M-r: perl:selection:rot13 45 URxvt.keysym.C-M-r: perl:selection:rot13
49 54
50 General API Considerations 55 General API Considerations
51 All objects (such as terminals, time watchers etc.) are typical 56 All objects (such as terminals, time watchers etc.) are typical
52 reference-to-hash objects. The hash can be used to store anything you 57 reference-to-hash objects. The hash can be used to store anything you
53 like. All members starting with an underscore (such as "_ptr" or 58 like. All members starting with an underscore (such as "_ptr" or
54 "_hook") are reserved for internal uses and must not be accessed or 59 "_hook") are reserved for internal uses and MUST NOT be accessed or
55 modified). 60 modified).
56 61
57 When objects are destroyed on the C++ side, the perl object hashes are 62 When objects are destroyed on the C++ side, the perl object hashes are
58 emptied, so its best to store related objects such as time watchers and 63 emptied, so its best to store related objects such as time watchers and
59 the like inside the terminal object so they get destroyed as soon as the 64 the like inside the terminal object so they get destroyed as soon as the
61 66
62 Hooks 67 Hooks
63 The following subroutines can be declared in loaded scripts, and will be 68 The following subroutines can be declared in loaded scripts, and will be
64 called whenever the relevant event happens. 69 called whenever the relevant event happens.
65 70
71 The first argument passed to them is an object private to each terminal
72 and extension package. You can call all "urxvt::term" methods on it, but
73 its not a real "urxvt::term" object. Instead, the real "urxvt::term"
74 object that is shared between all packages is stored in the "term"
75 member.
76
66 All of them must return a boolean value. If it is true, then the event 77 All of them must return a boolean value. If it is true, then the event
67 counts as being *consumed*, and the invocation of other hooks is 78 counts as being *consumed*, and the invocation of other hooks is
68 skipped, and the relevant action might not be carried out by the C++ 79 skipped, and the relevant action might not be carried out by the C++
69 code. 80 code.
70 81
98 queried and changed by calling "$term->selection". 109 queried and changed by calling "$term->selection".
99 110
100 Returning a true value aborts selection grabbing. It will still be 111 Returning a true value aborts selection grabbing. It will still be
101 hilighted. 112 hilighted.
102 113
114 on_sel_extend $term
115 Called whenever the user tries to extend the selection (e.g. with a
116 double click) and is either supposed to return false (normal
117 operation), or should extend the selection itelf and return true to
118 suppress the built-in processing.
119
120 See the selection example extension.
121
103 on_focus_in $term 122 on_focus_in $term
104 Called whenever the window gets the keyboard focus, before urxvt 123 Called whenever the window gets the keyboard focus, before urxvt
105 does focus in processing. 124 does focus in processing.
106 125
107 on_focus_out $term 126 on_focus_out $term
123 the total number of lines that will be in the scrollback buffer. 142 the total number of lines that will be in the scrollback buffer.
124 143
125 on_tty_activity $term *NYI* 144 on_tty_activity $term *NYI*
126 Called whenever the program(s) running in the urxvt window send 145 Called whenever the program(s) running in the urxvt window send
127 output. 146 output.
147
148 on_osc_seq $term, $string
149 Called whenever the ESC ] 777 ; string ST command sequence (OSC =
150 operating system command) is processed. Cursor position and other
151 state information is up-to-date when this happens. For
152 interoperability, the string should start with the extension name
153 and a colon, to distinguish it from commands for other extensions,
154 and this might be enforced in the future.
155
156 Be careful not ever to trust (in a security sense) the data you
157 receive, as its source can not easily be controleld (e-mail content,
158 messages from other users on the same system etc.).
128 159
129 on_refresh_begin $term 160 on_refresh_begin $term
130 Called just before the screen gets redrawn. Can be used for overlay 161 Called just before the screen gets redrawn. Can be used for overlay
131 or similar effects by modify terminal contents in refresh_begin, and 162 or similar effects by modify terminal contents in refresh_begin, and
132 restoring them in refresh_end. The built-in overlay and selection 163 restoring them in refresh_end. The built-in overlay and selection
138 on_keyboard_command $term, $string 169 on_keyboard_command $term, $string
139 Called whenever the user presses a key combination that has a 170 Called whenever the user presses a key combination that has a
140 "perl:string" action bound to it (see description of the keysym 171 "perl:string" action bound to it (see description of the keysym
141 resource in the rxvt(1) manpage). 172 resource in the rxvt(1) manpage).
142 173
174 Variables in the "urxvt" Package
175 $urxvt::TERM
176 The current terminal. Whenever a callback/Hook is bein executed,
177 this variable stores the current "urxvt::term" object.
178
143 Functions in the "urxvt" Package 179 Functions in the "urxvt" Package
144 urxvt::fatal $errormessage 180 urxvt::fatal $errormessage
145 Fatally aborts execution with the given error message. Avoid at all 181 Fatally aborts execution with the given error message. Avoid at all
146 costs! The only time this is acceptable is when the terminal process 182 costs! The only time this is acceptable is when the terminal process
147 starts up. 183 starts up.
221 answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont 257 answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont
222 borderLess color cursorBlink cursorUnderline cutchars delete_key 258 borderLess color cursorBlink cursorUnderline cutchars delete_key
223 display_name embed ext_bwidth fade font geometry hold iconName 259 display_name embed ext_bwidth fade font geometry hold iconName
224 imFont imLocale inputMethod insecure int_bwidth intensityStyles 260 imFont imLocale inputMethod insecure int_bwidth intensityStyles
225 italicFont jumpScroll lineSpace loginShell mapAlert menu meta8 modifier 261 italicFont jumpScroll lineSpace loginShell mapAlert menu meta8 modifier
226 mouseWheelScrollPage name pastableTabs path perl_eval perl_ext 262 mouseWheelScrollPage name pastableTabs path perl_eval perl_ext_1 perl_ext_2
227 perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd 263 perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd
228 reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating 264 reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating
229 scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput 265 scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput
230 scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle 266 scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle
231 shade term_name title transparent transparent_all tripleclickwords 267 shade term_name title transparent transparent_all tripleclickwords
273 right/bottom side, respectively. 309 right/bottom side, respectively.
274 310
275 This method returns an urxvt::overlay object. The overlay will be 311 This method returns an urxvt::overlay object. The overlay will be
276 visible as long as the perl object is referenced. 312 visible as long as the perl object is referenced.
277 313
278 Currently, the only method on the "urxvt::overlay" object is "set": 314 The methods currently supported on "urxvt::overlay" objects are:
279 315
280 $overlay->set ($x, $y, $text, $rend) 316 $overlay->set ($x, $y, $text, $rend)
281 Similar to "$term->ROW_t" and "$term->ROW_r" in that it puts text in 317 Similar to "$term->ROW_t" and "$term->ROW_r" in that it puts
282 rxvt-unicode's special encoding and an array of rendition values at 318 text in rxvt-unicode's special encoding and an array of
283 a specific position inside the overlay. 319 rendition values at a specific position inside the overlay.
320
321 $overlay->hide
322 If visible, hide the overlay, but do not destroy it.
323
324 $overlay->show
325 If hidden, display the overlay again.
284 326
285 $cellwidth = $term->strwidth $string 327 $cellwidth = $term->strwidth $string
286 Returns the number of screen-cells this string would need. Correctly 328 Returns the number of screen-cells this string would need. Correctly
287 accounts for wide and combining characters. 329 accounts for wide and combining characters.
288 330
321 363
322 $text = $term->ROW_t ($row_number[, $new_text[, $start_col]]) 364 $text = $term->ROW_t ($row_number[, $new_text[, $start_col]])
323 Returns the text of the entire row with number $row_number. Row 0 is 365 Returns the text of the entire row with number $row_number. Row 0 is
324 the topmost terminal line, row "$term->$ncol-1" is the bottommost 366 the topmost terminal line, row "$term->$ncol-1" is the bottommost
325 terminal line. The scrollback buffer starts at line -1 and extends 367 terminal line. The scrollback buffer starts at line -1 and extends
326 to line "-$term->nsaved". 368 to line "-$term->nsaved". Nothing will be returned if a nonexistent
369 line is requested.
327 370
328 If $new_text is specified, it will replace characters in the current 371 If $new_text is specified, it will replace characters in the current
329 line, starting at column $start_col (default 0), which is useful to 372 line, starting at column $start_col (default 0), which is useful to
330 replace only parts of a line. The font index in the rendition will 373 replace only parts of a line. The font index in the rendition will
331 automatically be updated. 374 automatically be updated.
352 395
353 See the section on RENDITION, above. 396 See the section on RENDITION, above.
354 397
355 $length = $term->ROW_l ($row_number[, $new_length]) 398 $length = $term->ROW_l ($row_number[, $new_length])
356 Returns the number of screen cells that are in use ("the line 399 Returns the number of screen cells that are in use ("the line
357 length"). If it is -1, then the line is part of a multiple-row 400 length"). Unlike the urxvt core, this returns "$term->ncol" if the
358 logical "line", which means all characters are in use and it is 401 line is joined with the following one.
359 continued on the next row.
360 402
403 $bool = $term->is_longer ($row_number)
404 Returns true if the row is part of a multiple-row logical "line"
405 (i.e. joined with the following row), which means all characters are
406 in use and it is continued on the next row (and possibly a
407 continuation of the previous row(s)).
408
409 $line = $term->line ($row_number)
410 Create and return a new "urxvt::line" object that stores information
411 about the logical line that row $row_number is part of. It supports
412 the following methods:
413
414 $text = $line->t
415 Returns the full text of the line, similar to "ROW_t"
416
417 $rend = $line->r
418 Returns the full rendition array of the line, similar to "ROW_r"
419
420 $length = $line->l
421 Returns the length of the line in cells, similar to "ROW_l".
422
423 $rownum = $line->beg
424 $rownum = $line->end
425 Return the row number of the first/last row of the line,
426 respectively.
427
428 $offset = $line->offset_of ($row, $col)
429 Returns the character offset of the given row|col pair within
430 the logical line.
431
432 ($row, $col) = $line->coord_of ($offset)
433 Translates a string offset into terminal coordinates again.
434
435 ($row, $col) = $line->coord_of ($offset) =item $text =
361 $text = $term->special_encode $string 436 $term->special_encode $string
362 Converts a perl string into the special encoding used by 437 Converts a perl string into the special encoding used by
363 rxvt-unicode, where one character corresponds to one screen cell. 438 rxvt-unicode, where one character corresponds to one screen cell.
364 See "$term->ROW_t" for details. 439 See "$term->ROW_t" for details.
365 440
366 $string = $term->special_decode $text 441 $string = $term->special_decode $text
446ENVIRONMENT 521ENVIRONMENT
447 URXVT_PERL_VERBOSITY 522 URXVT_PERL_VERBOSITY
448 This variable controls the verbosity level of the perl extension. Higher 523 This variable controls the verbosity level of the perl extension. Higher
449 numbers indicate more verbose output. 524 numbers indicate more verbose output.
450 525
451 0 - only fatal messages 526 =0 - only fatal messages
452 3 - script loading and management 527 =3 - script loading and management
453 10 - all events received 528 =10 - all events received
454 529
455AUTHOR 530AUTHOR
456 Marc Lehmann <pcg@goof.com> 531 Marc Lehmann <pcg@goof.com>
457 http://software.schmorp.de/pkg/rxvt-unicode 532 http://software.schmorp.de/pkg/rxvt-unicode
458 533

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines