Re: Getting application ReadLine and Perl debugger ReadLine to cooperate




Quoth Andrew DeFaria <adefaria@xxxxxxxxx>:
I have an example Perl script that uses Term::ReadLine::Gnu to provide
ReadLine support with command history:

#!/usr/local/bin/perl
use Term::ReadLine;
use Term::ReadLine::Gnu;

<snip>

When run it runs fine, doesn't do much, but dutifully reads commands
and stores them in the history. IOW up arrow works to recall commands
and I can edit them. IOW Term::ReadLine::Gnu is installed properly and
functioning.

Now I wish to debug this script. So I do perl -d testReadLine.pl.
Initially the Perl debugger works. I can do commands like l for list
or s for step. However, as soon as I return from the new
Term::ReadLine the debugger is confused. No command does anything.

I fully suspect that the problem lies in the fact that both my Perl
script and the Perl debugger are fighting over STDIN/STDOUT and
confusing each other. The question is how to get them both to play
nice.

It may also be because the debugger is also using Term::Readline::Gnu. I
don't know if the underlying readline library can cope with two users at
once. You may want to try the debugger options TTY and ReadLine (see
perldoc perldebug).

Ben

.



Relevant Pages

  • Re: Swing thread problem
    ... already has the same problem that has my real program (where commands ... by your responses that this works for you. ... I now replaced the invokeLater with invokeAndWait - this works better, ... It appears that when the program reaches the readLine() line the event- ...
    (comp.lang.java.gui)
  • Getting application ReadLine and Perl debugger ReadLine to cooperate
    ... ReadLine support with command history: ... When run it runs fine, doesn't do much, but dutifully reads commands ... Initially the Perl debugger works. ... confusing each other. ...
    (comp.lang.perl.misc)
  • Re: Swing thread problem
    ... already has the same problem that has my real program (where commands ... by your responses that this works for you. ... I now replaced the invokeLater with invokeAndWait - this works better, ... It appears that when the program reaches the readLine() line the event- ...
    (comp.lang.java.gui)
  • Re: Ruby readline - completion based on already-entered commands
    ... I have the basics of readline working; ... >> commands? ...
    (comp.lang.ruby)
  • Asynchronous readline?
    ... I am developing a console application that accepts typed commands from ... "readline", except that readline doesn't work asynchronously AFAIK)? ...
    (comp.lang.perl.misc)