How to implement a command history on a telnet client? (up/down arrows)
use socat:
socat readline,history=$HOME/.telnet_history TCP:host:23
I'm assuming this is a service you have written in Perl, based on your tags.
You can use the Term::ReadLine module from CPAN to do what you want. From the CPAN website, here's a basic example:
use Term::ReadLine; my $term = Term::ReadLine->new('My Management Service'); my $prompt = "Enter your management command: "; my $OUT = $term->OUT || \*STDOUT; while ( defined ($_ = $term->readline($prompt)) ) { my $res = eval($_); warn $@ if $@; print $OUT $res, "\n" unless $@; $term->addhistory($_) if /\S/; }