]> projects.mako.cc - muttjump/commitdiff
escape '\' in git versions of GNU screen
authorJohannes Weißl <jargon@molb.org>
Mon, 6 Dec 2010 09:25:14 +0000 (10:25 +0100)
committerJohannes Weißl <jargon@molb.org>
Mon, 6 Dec 2010 09:25:14 +0000 (10:25 +0100)
TODO [deleted file]
muttjump

diff --git a/TODO b/TODO
deleted file mode 100644 (file)
index b18b6d4..0000000
--- a/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-- Jumping in mutt doesn't work with git-versions of screen if Message-ID
-  contains characters which must be escaped (screen -X screen ...)
index 3cdb6ed10bc25e49463b17864a905985518da7ed..6f5a1d394d271e24731d7e7f4579d05686aaa508 100755 (executable)
--- a/muttjump
+++ b/muttjump
@@ -43,6 +43,10 @@ if ! type MUTTJUMP_SCREEN_WINDOW_NAME_MANGLE >/dev/null 2>&1 ; then
     }
 fi
 
+# Version of GNU screen
+# Since 4.01.00 (commit d87a0d8) backslash handling was altered.
+MUTTJUMP_SCREEN_VERSION=${MUTTJUMP_SCREEN_VERSION:-auto}
+
 # program paths
 MUTT=${MUTT:-mutt}
 MAIRIX=${MAIRIX:-mairix}
@@ -232,6 +236,13 @@ if [ "$MUTTJUMP_MULTI_SCREEN_MODE" = no ] ; then
     if [ "$MUTTJUMP_USE_SCREEN" = yes ] ; then
         if [ -n "$STY" ] ; then
             screen_opts=("-X" "screen")
+            sv=$MUTTJUMP_SCREEN_VERSION
+            if [ "$sv" = auto ] ; then
+                sv=$($SCREEN --version | awk '{print $3}')
+            fi
+            if ! echo "$sv" | grep -q "^\(4\.00\|[0-3]\.\)" ; then
+                jump_cmd=${jump_cmd/\\/\\\\\\}
+            fi
         else
             reopen_tty
         fi

Benjamin Mako Hill || Want to submit a patch?