echo "no dirs in ~/.cdirs"
return 0
fi
- read -r -N 1 input
+ read -sr -N 1 input
if [[ $input != $'\n' ]]; then
c "${buttondirs[$input]}"
fi
local ps_char ps_color col tmp
- IFS='[;' read -p $'\e[6n' -d R -rs tmp
- col="${tmp##*[^0-9]}"
+ # bash 5.0.17 gives an error when the last command used a process redirect like
+ # while read -r l; do e $l; done < <(echo ok)
+ if [[ ! $LC_INSIDE_EMACS && $BASH_VERSION == 5.[123456789]* || $BASH_VERSION == [6789]* ]]; then
+ IFS='[;' read -p $'\e[6n' -d R -rs tmp ||:
+ col="${tmp##*[^0-9]}"
+ fi
unset IFS
# If the last command was not newline terminated, add a space (so we
# can more easily copy the output if needed), and an indicator to
# help us not be confused.
- if [[ $col != 1 ]]; then
+ if [[ $col && $col != 1 ]]; then
PS1=" \[$term_yellow\]█\[$term_nocolor\]$PS1"
fi