… | |
… | |
142 | $self = $class->SUPER::new ($arg{name} || $0, $in, $out); |
142 | $self = $class->SUPER::new ($arg{name} || $0, $in, $out); |
143 | |
143 | |
144 | $self->CallbackHandlerInstall ($prompt, \&on_line); |
144 | $self->CallbackHandlerInstall ($prompt, \&on_line); |
145 | # set the unadorned prompt |
145 | # set the unadorned prompt |
146 | $self->rl_set_prompt ($prompt); |
146 | $self->rl_set_prompt ($prompt); |
|
|
147 | $self->redisplay; |
147 | |
148 | |
148 | $hidden = 1; |
149 | $hidden = 1; |
149 | $self->show; |
150 | $self->show; |
150 | |
151 | |
151 | $self |
152 | $self |
… | |
… | |
240 | |
241 | |
241 | 1; |
242 | 1; |
242 | |
243 | |
243 | =back |
244 | =back |
244 | |
245 | |
|
|
246 | =head1 CAVEATS |
|
|
247 | |
|
|
248 | There are some issues with readline that can be problematic in event-based |
|
|
249 | programs: |
|
|
250 | |
|
|
251 | =over 4 |
|
|
252 | |
|
|
253 | =item blocking I/O |
|
|
254 | |
|
|
255 | Readline uses blocking terminal I/O. Under most circumstances, this does |
|
|
256 | not cause big delays, but ttys have the potential to block programs |
|
|
257 | indefinitely (e.g. on XOFF). |
|
|
258 | |
|
|
259 | =item unexpected disk I/O |
|
|
260 | |
|
|
261 | By default, readline does filename completion on TAB, and reads its |
|
|
262 | config files. |
|
|
263 | |
|
|
264 | Tab completion can be disabled by calling C<< $rl->unbind_key (9) >>. |
|
|
265 | |
|
|
266 | =item tty settings |
|
|
267 | |
|
|
268 | After readline has been initialised, it will mangle the termios tty |
|
|
269 | settings. This does not normally affect output very much, but should be |
|
|
270 | taken into consideration. |
|
|
271 | |
|
|
272 | =item output intermixing |
|
|
273 | |
|
|
274 | Your program might wish to print messages (for example, log messages) to |
|
|
275 | STDOUT or STDERR. This will usually cause confusion, unless readline is |
|
|
276 | hidden with the hide method. |
|
|
277 | |
|
|
278 | =back |
|
|
279 | |
|
|
280 | Oh, and the above list is probably not complete. |
|
|
281 | |
245 | =head1 AUTHOR, CONTACT, SUPPORT |
282 | =head1 AUTHOR, CONTACT, SUPPORT |
246 | |
283 | |
247 | Marc Lehmann <schmorp@schmorp.de> |
284 | Marc Lehmann <schmorp@schmorp.de> |
248 | http://software.schmorp.de/pkg/AnyEvent-Readline-Gnu.html |
285 | http://software.schmorp.de/pkg/AnyEvent-ReadLine-Gnu.html |
249 | |
286 | |
250 | =cut |
287 | =head1 SEE ALSO |
251 | |
288 | |
|
|
289 | L<rltelnet> - a simple tcp_connect-with-readline program using this module. |
|
|
290 | |
|
|
291 | =cut |
|
|
292 | |