From 528657a4268e13eec602ac6227e24e9588d984bf Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 12 May 2021 16:18:08 -0400 Subject: [PATCH] bin/org-capture: fix hanging The script's stdin check was too simplistic and would block forever waiting for input. From now on, to pipe to the script, pass it a dash. --- bin/org-capture | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/org-capture b/bin/org-capture index c7075dcb6..d52e84a50 100755 --- a/bin/org-capture +++ b/bin/org-capture @@ -28,11 +28,11 @@ while getopts "hk:" opt; do done shift $((OPTIND-1)) -# use remaining args, else try stdin +# use remaining args, else read from stdin if passed a single dash str="$*" -if [ -z "$str" ]; then - str=$(cat) -fi +case "$str" in + -) str=$(cat) ;; +esac # Fix incompatible terminals that cause odd 'not a valid terminal' errors [ "$TERM" = "alacritty" ] && export TERM=xterm-256color