export SELECTOR_CD_HISTORY
-[[ "${SELECTOR_CD_HISTORY}" ]] || SELECTOR_CD_HISTORY=${HOME}/.selector-cd-history
+[[ "${SELECTOR_CD_HISTORY}" ]] || SELECTOR_CD_HISTORY="${HOME}/.selector-cd-history"
export SELECTOR_CD_HISTORY_SIZE
if [[ -f "${SELECTOR_CD_HISTORY}" ]]; then
TMP=$(mktemp /tmp/selector-cd.XXXXXX)
- tail -$((SELECTOR_CD_HISTORY_SIZE-1)) < "${SELECTOR_CD_HISTORY}" > "${TMP}"
- cat "${TMP}" > "${SELECTOR_CD_HISTORY}"
+ tail -$((SELECTOR_CD_HISTORY_SIZE-1)) < "${SELECTOR_CD_HISTORY}" >| "${TMP}" && \
+ cat "${TMP}" >| "${SELECTOR_CD_HISTORY}"
\rm -f "${TMP}"
fi
--hist)
# M-r puts the selected history line in place of the current one
- bind '"\C-[r":"\C-a\C-kselector-history\C-m"'
+ bind '"\C-[r":"\C-a\C-k selector-history\C-m"'
;;
--cd)
# M-c provides a dynamic list of directories to cd into
- bind '"\C-[c":"\C-a\C-kselector-cd-search\C-m"'
+ bind '"\C-[c":"\C-a\C-k selector-cd-search\C-m"'
;;
*)