summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmutt-open7
1 files changed, 4 insertions, 3 deletions
diff --git a/mutt-open b/mutt-open
index 00dbca1..2e74833 100755
--- a/mutt-open
+++ b/mutt-open
@@ -7,7 +7,8 @@ set -euo pipefail
command=$1
file=$2
-tmpdir=$(mktemp -d 'mutt-open.XXXXXXXXX')
-filename="${1##*/}"
+tmpdir=$(mktemp -p /tmp -d 'mutt-open.XXXXXXXXX')
+filename="${file##*/}"
cp "$file" "$tmpdir/$filename"
-systemd-cat "$command" "$tmpdir/$filename"
+systemd-cat "$command" "$tmpdir/$filename" &
+disown