fi
TMP=$(mktemp /tmp/selector-cd.XXXXXX)
tail -1000 < ${SELECTOR_CD_HISTORY} > ${TMP}
- echo $PWD | sed -e "s!${HOME}!~!" >> ${TMP}
+ echo $PWD | sed -e "s!^${HOME}!~!" >> ${TMP}
cat ${TMP} > ${SELECTOR_CD_HISTORY}
rm -f ${TMP}
}
selector -u -t "cd" -l 10000 -d -i -c 7,2,0,3 -o ${PATH_TEMP} -q ${SELECTOR_CD_HISTORY}
NEW_PATH="$(cat ${PATH_TEMP} | sed -e 's!~!'${HOME}'!')"
if [[ -s "${NEW_PATH}" ]]; then
- selector-cd "$(cat ${PATH_TEMP} | sed -e 's!~!'${HOME}'!')"
+ selector-cd "$(cat ${PATH_TEMP} | sed -e 's!^~!'${HOME}'!')"
fi
\rm ${PATH_TEMP}
}