in reply to Term::ReadLine handle wide character poorly

I see an issue in your sample code;
You don't need $term->addhistory($note) if $note =~ /\S/; - The readline method already adds to the history.
But using addhistory you are doubling everything in your history.

Replies are listed 'Best First'.
Re^2: Term::ReadLine handle wide character poorly
by vincentaxhe (Scribe) on May 15, 2024 at 11:00 UTC
    indeed, I preload some history by     $term->addhistory($_) foreach split "\n", $tasks[$selectedtask]{note} // ""; I assume its all manually, and perldoc also give example like this. thx