mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 113445d9639fbc73b40edf9b727e26c40c3359ab
parent 407a1dc43f134b3c5b5c1bbb1caf8f26fc83abad
Author: Duncaen <mail@duncano.de>
Date:   Thu,  2 Feb 2017 16:03:10 +0100

contrib/mvi: fix cmdline and add ! to eval commands

Diffstat:
contrib/mvi | 17++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/contrib/mvi b/contrib/mvi @@ -30,14 +30,21 @@ cmdline() { stty "$stty_default" tput cnorm read -r cmd + stty -echo -icanon case "$cmd" in "|"*) ;; - "!"*) ;; + "!"*) + tput sgr0 && tput rmcup # restore to content before mvi + eval "${cmd#!*}" + # wait for enter, and delete message + tput sc; printf "[enter to continue]" && read -r d; tput rc; tput el + tput smcup # save new content + ;; + q) close ;; esac printf "%s" "$term_done_cmd" - stty -echo -icanon - headers - body + update_body=1 + draw } update() { @@ -147,7 +154,7 @@ in_back() { in_prefix() { n= - while [ "$in_key" -le 59 ] && [ "$in_key" -ge 47 ]; do + while [ "$in_key" -le 57 ] && [ "$in_key" -ge 48 ]; do : $(( n = n * 10 + $(printf \\$(printf "%03o" "$in_key")) )) in_read done