xontrib-back2dir

Return to the most recently used directory when starting the xonsh shell.

MIT License

Downloads
477
Stars
11
Committers
3

Installation

To install use pip:

xpip install xontrib-back2dir
# or: xpip install -U git+https://github.com/anki-code/xontrib-back2dir
echo "xontrib load back2dir" > ~/.xonshrc

Usage

No additional actions needed. The xontrib just saves the latest directory and uses it when xonsh starts:

bash   ~     $ xonsh
xonsh  ~     $ cd /etc
xonsh  /etc  $ exit     # the latest directory is /etc

bash   ~     $ xonsh
xonsh  /etc  $ # the latest directory

If you run xonsh not from the $HOME directory the latest directory will be ignored:

bash   ~     $ cd /tmp
bash   /tmp  $ xonsh
xonsh  /tmp  $ # latest directory ignored

Links