Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Problem with Term::Readline with ssh

by hisycg@gmail.com (Initiate)
on Apr 02, 2013 at 13:54 UTC ( #1026691=perlquestion: print w/replies, xml ) Need Help??
hisycg@gmail.com has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to use the example code from Term::Readline: http://perldoc.perl.org/Term/ReadLine.html
use Term::ReadLine; my $term = Term::ReadLine->new('Simple Perl calc'); my $prompt = "Enter your arithmetic expression: "; my $OUT = $term->OUT || \*STDOUT; while ( defined ($_ = $term->readline($prompt)) ) { my $res = eval($_); warn $@ if $@; print $OUT $res, "\n" unless $@; $term->addhistory($_) if /\S/; }
It works fine on local machine, but if I put the script on a remote server, then I log in the the server with ssh and execute the script, it does not recognize my up arrow anymore, it only show "^[[A" when I press up arrow. Could anyone give a hint how to fix/debug this? I'm using ubuntu 12.04.

Replies are listed 'Best First'.
Re: Problem with Term::Readline with ssh
by LanX (Bishop) on Apr 02, 2013 at 14:01 UTC
    Just a guess:

    IIRC thats what the debugger shows if gnu's readline is not installed...

    HTH!

    Cheers Rolf

    ( addicted to the Perl Programming Language)

    Update

    yep, searching helps

    see Re: Previous commands in Ubuntu terminal

    and try sudo apt-get install libterm-readline-gnu-perl on your remote host.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1026691]
Approved by ww
help
Chatterbox?
[robby_dobby]: Likewise! I haven't seen a lot of people with HAs back where I come from, so I figured it might be the same around here too...
[robby_dobby]: Oh, shit -- I was replying to someone, but it wound up here. -_-
robby_dobby is still not used to PM's interface. /o\
[oiskuu]: War. War never changes.
[robby_dobby]: "My cat is a very good mouser" -- that's a great way to identify a Brit among a crowd :-)
thezip looks around to see no one else dancing to Piazzola...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2017-11-17 19:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (272 votes). Check out past polls.

    Notices?