iridakos / goto

Alias and navigate to directories with tab completion in Linux
https://iridakos.com/programming/2019/04/10/shell-navigation-with-autocomplete
MIT License
879 stars 63 forks source link

Improve compatibility with various bash configs #52

Closed escozul closed 5 years ago

escozul commented 5 years ago

For people who work a lot of time on their terminal, there is a high likelihood that they have made some bash configuration changes that might break goto. For example, if the .bashrc file or .bash_profile include an improvement of the cd command, goto -r will not work as it takes info about registering aliases from the output of the cd command. For example, you might have a cd() { builtin cd "$@" && ll; } in your .bash_profile that always lists contents when cd-ing. When trying to use goto with that configuration the -r function will alias the entire directory listing which will obviously not work.

So I changed all cd calls in goto.sh with builtin cd which forces to use the default output of a cd command.

Tested that on Centos and MACOS.

iridakos commented 5 years ago

Hi @escozul and thank you very much for the contribution! :+1: :+1: