scmbreeze / scm_breeze

Adds numbered shortcuts to the output git status, and much more
https://madebynathan.com/2011/10/19/git-shortcuts-like-youve-never-seen-before/
MIT License
2.82k stars 192 forks source link

Switching to git index doesn't mantain $OLDPWD correctly #217

Closed tjlevine closed 7 years ago

tjlevine commented 7 years ago

When I switch to my projects directory with the 's' (by default it is aliased to 'c', but it's overwritten to be the old default 's' in my installs, check your git_index_alias), my $OLDPWD is overwritten, so cd - does not work as expected. The easiest way for me to show this is with an example:

tylevine@TYLEVINE-M-X247:~/src/kafka ((0.9.0.1)) $ pwd
/Users/tylevine/src/kafka
tylevine@TYLEVINE-M-X247:~/src/kafka ((0.9.0.1)) $ s
tylevine@TYLEVINE-M-X247:~/src $ echo $OLDPWD
/Users/tylevine/src
tylevine@TYLEVINE-M-X247:~/src $ cd -
/Users/tylevine/src

Here I'm in the kafka subdirectory, I want to change to my projects directory and then go back to the kafka directory, but my $OLDPWD is set to ~/src instead of ~/src/kafka, so I don't actually go anywhere.

tjlevine commented 7 years ago

I figured out this is actually caused by an unrelated issue in autoenv: https://github.com/kennethreitz/autoenv/issues/141