From b451b0e92b9bff3bfdd5cb55fec194bc8ec94289 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johannes=20Wei=C3=9Fl?= Date: Mon, 6 Dec 2010 11:29:48 +0100 Subject: [PATCH] integrate multi-mode --- muttjump | 73 +++++++++++++++++++++++++------------------------------- 1 file changed, 32 insertions(+), 41 deletions(-) diff --git a/muttjump b/muttjump index 2f60b3b..2062ac5 100755 --- a/muttjump +++ b/muttjump @@ -79,6 +79,14 @@ function wc_L () { awk '{ y = length(); if (y > x) x = y } END { print x }' } +function is_new_screen () { + sv=$MUTTJUMP_SCREEN_VERSION + if [ "$sv" = auto ] ; then + sv=$($SCREEN --version | awk '{print $3}') + fi + echo "$sv" | grep -vq "^\(4\.00\|[0-3]\.\)" +} + function usage () { cat >&2 </dev/null - if [ $? != 0 ] ; then - $SCREEN -X screen -t "$screen_window_name" $MUTT -f "$orig_maildir" -e "push \"$jump_cmd\"" - else - $SCREEN -X -p "$screen_window_name" stuff "$jump_cmd_short" - fi + fi + if [ $? = 0 ] ; then + $SCREEN -X -p "$screen_window_name" stuff ":push \"$jump_cmd\" " + exit 0 fi fi + +# start mutt, open original folder and jump to the original message +$SCREEN "${screen_opts[@]}" $MUTT -f "$orig_maildir" -e "push \"$jump_cmd\"" -- 2.39.5