Merge pull request #4744 from edrex/org-capture-nonint-text

org-capture: accept text arg non-interactively
This commit is contained in:
Henrik Lissner 2021-03-07 13:09:58 -05:00 committed by GitHub
commit a7427bb563
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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