In a CB-discussion we figured out a way to have a persistent input history for the perl-debugger,
alias pdb="rlwrap -H .perl_history perl -de0"
CAUTION: This alias will overwrite the python debugger "pdb", a price addicts like PythonFan would never pay!
you might need to disable readline-support in the .perldb file
parse_options("TTY=/dev/stdin ReadLine=0");
(should be possible to supply this last option on the CLI within the alias, but I couldn't figure it out within a posts timespan.)
Tested on Ubuntu Linux. Please post if and how it works for you!
Cheers Rolf
how can I set up the perldebugger to log the history?
LanX 2011-04-12 17:01:38 UTC
LanX aksed before googling...
tye 2011-04-12 17:02:40 UTC
perl debugger readline rather sucks, IME. Several times I've managed to get it working, but not recently (except on Win32)
tye 2011-04-12 17:03:48 UTC
the default behavior is almost as bad as the default behavior of CPAN.pm :)
ambrus 2011-04-12 17:05:07 UTC
I for one run programs that have a bad builtin readline-alike with no tab completion inside rlwrap instead, for that's often better than the builtin readline, and it's easier on me to have to learn just one readline variant. This includes GAP foremost,
ambrus 2011-04-12 17:05:31 UTC
because its builtin readline has very unusual bindings.
ambrus 2011-04-12 17:06:14 UTC
I think authors shouldn't bother with adding readline in their program unless they actually make it specialized for that program in some useful way, such as with custom tab expansion.
Corion 2011-04-12 17:06:20 UTC
Heh. Github is far too easy as a publishing platform :-) (second installment of App::ffeedflotr)
tye 2011-04-12 17:09:19 UTC
yes, I've been using rlwrap more. custom tab expansion should still be done w/in standard readline.
Corion 2011-04-12 17:10:24 UTC
I think I have/had readline+tab expansion working on 5.10/Win32 for one of my toy programs (the one to explore Moose).. Let me see if the Makefile.PL tells me the appropriate summoning ...
tye 2011-04-12 17:10:44 UTC
ah. red = 'pass', green = 'fail'. how intuitive, Corion q-:
LanX 2011-04-12 17:10:46 UTC
How to use? rlwrap -l .perl_history perl -de0?
ambrus 2011-04-12 17:11:16 UTC
tye: color blind friendly setting
tye 2011-04-12 17:12:00 UTC
perl -d doesn't read command from stdin, however. so I don't think rlwrap is easy to use with the perl debugger.
LanX 2011-04-12 17:12:28 UTC
well the input IS logged ...
Corion 2011-04-12 17:12:32 UTC
Term::ShellUI seems the thing to summon from the deep - at least then I get tab expansion in that program.
tye 2011-04-12 17:12:46 UTC
yes, ambrus, having green mean 'fail' makes it much easy to see green than having green mean 'pass'
Corion 2011-04-12 17:13:06 UTC
tye: Hey! Setting colours is next on my list (for just that reason :-P )
yitzchak 2011-04-12 17:13:12 UTC
Pow-wow magic on the web? http://stackoverflow.com/questions/5638991/sending-hex-characters-over-a-socket
Corion 2011-04-12 17:13:45 UTC
tye: A colleague had UI requirements of a red checkmark and a green cross :-)
LanX 2011-04-12 17:15:21 UTC
The web should invest more in color filters than xxx filters...
LanX 2011-04-12 17:18:17 UTC
LanX wants NSFD tags! (D=Daltonians) :)
yitzchak 2011-04-12 17:19:17 UTC
try parse_options("TTY=/dev/stdin ReadLine=false"); in .perldb
yitzchak 2011-04-12 17:19:22 UTC
(with rlwrap)
tye 2011-04-12 17:20:06 UTC
ah, good idea, yitzchak
yitzchak 2011-04-12 17:20:07 UTC
maybe it should be ReadLine=0; I don't appear to have working readline support at the moment, so I don't know
tye 2011-04-12 17:20:48 UTC
heh
LanX 2011-04-12 17:23:25 UTC
0 works almost I'm getting the last command in "binary" format
LanX 2011-04-12 17:25:06 UTC
^[[4m DB<2> ^[[4m DB<2> ^[[24m^[[1m$vi=666
LanX 2011-04-12 17:25:21 UTC
was $vi=666
LanX 2011-04-12 17:26:13 UTC
this only happens for logged entries from old sessions, the history for the current session seems to work well
LanX 2011-04-12 17:27:03 UTC
but thanks!
SuicideJunkie 2011-04-12 17:28:36 UTC
That looks like escape codes for color/bold console text
yitzchak 2011-04-12 17:28:44 UTC
take that, Ilya
yitzchak 2011-04-12 17:28:52 UTC
:)
LanX 2011-04-12 17:29:15 UTC
wait ...
LanX 2011-04-12 17:29:57 UTC
AHHH! it worklks I used the wrong option for rlwrap!
LanX 2011-04-12 17:30:22 UTC
rlwrap -H .perl_history perl -de0
LanX 2011-04-12 17:31:01 UTC
LanX 2011-04-12 17:31:08 UTC
:)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Persistent readline history with perldb
by mirod (Canon) on Apr 13, 2011 at 06:07 UTC | |
by LanX (Saint) on Apr 13, 2011 at 09:55 UTC |