org-capture: text from args, else stdin

old behavior was to use stdin in non-interactive
This prevented binding eg in qutebrowser
This commit is contained in:
Eric Drechsel 2021-03-07 00:48:32 -08:00
parent e8bd115307
commit 269dab615c

View file

@ -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