aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/fair-viewer13
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/fair-viewer b/bin/fair-viewer
index bb30e6a..ebe8dd5 100755
--- a/bin/fair-viewer
+++ b/bin/fair-viewer
@@ -576,9 +576,7 @@ if ($opt{history}) {
}
# Add history to Term::ReadLine
- if (eval { $term->can('ReadHistory') }) {
- $term->ReadHistory($opt{history_file});
- }
+ eval { $term->ReadHistory($opt{history_file}) };
# All history entries
my @history = $term->history_list;
@@ -1924,7 +1922,11 @@ sub get_user_input {
my $input = unpack(
'A*', defined($opt{std_input})
? delete($opt{std_input})
- : ($term->readline($text) // return ':return')
+ : (do {
+ my @lines = split(/\R/, $text);
+ say for @lines[0..$#lines-1];
+ $term->readline($lines[-1]);
+ } // return ':return')
) =~ s/^\s+//r;
return q{:next} if $input eq q{}; # <ENTER> for the next page
@@ -4170,7 +4172,8 @@ sub print_videos {
}
sub press_enter_to_continue {
- scalar $term->readline(colored("\n=>> Press ENTER to continue...", 'bold'));
+ say '';
+ scalar $term->readline(colored("=>> Press ENTER to continue...", 'bold'));
}
sub main_quit {