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.
This commit is contained in:
parent
ff3c9777e7
commit
528657a426
1 changed files with 4 additions and 4 deletions
|
@ -28,11 +28,11 @@ while getopts "hk:" opt; do
|
||||||
done
|
done
|
||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
# use remaining args, else try stdin
|
# use remaining args, else read from stdin if passed a single dash
|
||||||
str="$*"
|
str="$*"
|
||||||
if [ -z "$str" ]; then
|
case "$str" in
|
||||||
str=$(cat)
|
-) str=$(cat) ;;
|
||||||
fi
|
esac
|
||||||
|
|
||||||
# Fix incompatible terminals that cause odd 'not a valid terminal' errors
|
# Fix incompatible terminals that cause odd 'not a valid terminal' errors
|
||||||
[ "$TERM" = "alacritty" ] && export TERM=xterm-256color
|
[ "$TERM" = "alacritty" ] && export TERM=xterm-256color
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue