even shorter solution
[muttjump] / muttjump
index 8ff2625d3a63462ca455c282a68077d9e5d10341..e2f04ecee410806210ff65b98f439069f77f9050 100755 (executable)
--- a/muttjump
+++ b/muttjump
@@ -143,7 +143,7 @@ if [ "$MUTTJUMP_USE_SCREEN" = no ] ; then
     # mutt behaves different if STDIN is no terminal
     # TODO: Find cleaner solution (e.g. mutt command-line argument?)
     exec 0<&-
     # mutt behaves different if STDIN is no terminal
     # TODO: Find cleaner solution (e.g. mutt command-line argument?)
     exec 0<&-
-    term="/dev/$(ps -p$$ | awk 'END { print $2 }')"
+    term="/dev/$(ps -p$$ -otty=)"
     exec < $term
 
     # start mutt, open original folder and jump to the original message
     exec < $term
 
     # start mutt, open original folder and jump to the original message

Benjamin Mako Hill || Want to submit a patch?