From 269dab615c2d382c08e6f0ccb2188977a5a70df4 Mon Sep 17 00:00:00 2001 From: Eric Drechsel Date: Sun, 7 Mar 2021 00:48:32 -0800 Subject: [PATCH] org-capture: text from args, else stdin old behavior was to use stdin in non-interactive This prevented binding eg in qutebrowser --- bin/org-capture | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/org-capture b/bin/org-capture index 72dc0ac5b..d7e4538d5 100755 --- a/bin/org-capture +++ b/bin/org-capture @@ -28,7 +28,11 @@ while getopts "hk:" opt; do done shift $((OPTIND-1)) -[ -t 0 ] && str="$*" || str=$(cat) +# use remaining args, else try stdin +str="$*" +if [ -z $str ]; then + str=$(cat) +fi # Fix incompatible terminals that cause odd 'not a valid terminal' errors [ "$TERM" = "alacritty" ] && export TERM=xterm-256color