dundalek / closh

Bash-like shell based on Clojure
Eclipse Public License 1.0
1.61k stars 65 forks source link

Add support `cd -` got to prev directory #167

Closed kirillsalykin closed 4 years ago

kirillsalykin commented 4 years ago

closes #166

This PR add support for cd -.

Implementation based on https://pubs.opengroup.org/onlinepubs/9699919799/utilities/cd.html.

In case if $OLDPWD is not set up - ~ used. iTerm2 also uses same approach (with ~ as default), but builtin terminal doesn't. (I am on mac os)

For me iTerm2 behavior feels more natural, but maybe you have other thoughts?

Thanks.