Quantcast
Channel: Active questions tagged fish - Stack Overflow
Viewing all articles
Browse latest Browse all 106

FISH Shell - Cannot `cd -` when extending builtin cd

$
0
0

I have a custom cd function that looks like:

function cd -d "cd with auto conda activation"    # set -gx OLDPWD (pwd) <-- uncommenting this does not resolve issue    builtin cd $param $argv    if test -f (pwd)/.condaconfig        set -gx CONDACONFIGDIR (pwd)        conda activate (cat .condaconfig)    else if [ -n "$CONDACONFIGDIR" ]        if [ -n (string match -q -- "*$CONDACONFIGDIR*" (pwd)) ]            set -gx CONDACONFIGDIR ""            conda deactivate        end    endend

but with this active, I cannot use cd - to change to the previous directory.Have I implemented builtin wrong? I feel like I'm missing something here.

I have an equivalent custom function in bash which works fine and continues setting/using OLDPWD - fish seems to use something else to keep track of previous directory, but it's not an environment variable (ie. doesn't show up in the output of env)


Viewing all articles
Browse latest Browse all 106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>