Hi:

 

I'm experimenting with Term::Readline as a way to emulate a CLI from
within perl.  One of the annoying things it does is to alter the display
characteristics of the string I ask the "readline" method to use as a
prompt.  It always gets underlined, sometimes the color gets changed and
sometimes it's in bold.  Seems to be a function of the terminal
characteristics, but I'm not sure which ones :-(    

Here's a code example.....

 

use Term::ReadLine;

 

$term = new Term::ReadLine 'Try';

$prompt = "Enter a color: ";

$OUT = $term->OUT || STDOUT;

 

for(;;)

  {

  $inp = $term->readline($prompt);

  chomp($inp);

  if($inp eq "exit") {exit;}

  print $OUT "I like $inp too\n";

  $term->addhistory($inp);

  }

exit;

 

When run, the prompt comes out......

Enter a color: 

or on a different terminal type, maybe...

Enter a color:

 

Is there a way I can get a handle on this?

 

Also, while I've got your attention, the up/down arrows (prev/next in
the history of commands) seem to work, but you have to hit the up or
down arrow twice before it'll respond.  Any ideas?

 

Thanks

-dave

 

 

Reply via email to