diff --git a/plugins/statiegeld b/plugins/statiegeld index dfe1a40..63e49c5 100644 --- a/plugins/statiegeld +++ b/plugins/statiegeld @@ -101,15 +101,19 @@ sub hook_added_entry ($class, $cart, $entry, @) { } } +# Override main revbank prompt sub hook_prompt { # ($class, $cart, $prompt), but via @_ for mutable alias $S or return; - my $statiegeld_prompt = "\x01\e[33;1m\x02+>\x01\e[0m\x02"; # yellow "+>" + my $m = "Scan products for deposit return."; + + # The message is prepended to the prompt, so it is printed after + # clear-screen (^L). + # ignore----------end ignore-----end + # yellow----------------reset + my $statiegeld_prompt = "\x01\e[33;1m\x02$m\n+>\x01\e[0m\x02"; + # Actual text: ^^^^^^ - if ($_[2] eq "" or $_[2] eq $statiegeld_prompt) { - # Assumption: only the main prompt will have fewer than 3 \w characters - print "\e[33;1mScan products for deposit return.\e[0m\n" if not $_[1]->size; - } $_[2] =~ s/^$/$statiegeld_prompt/; }