wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.4k stars 137 forks source link

`set -x FORGIT_INSTALL_DIR` causing fish to cd into config dir on startup #165

Closed petertriho closed 2 years ago

petertriho commented 2 years ago

Check list

Environment info

Problem / Steps to reproduce

Looks like these changes https://github.com/wfxr/forgit/pull/164, specifically https://github.com/wfxr/forgit/blob/eb6db722cd494c4678a0e8c849c9d838ff42042c/conf.d/forgit.plugin.fish#L15 is causing fish to start up in ~/.config/fish

petertriho commented 2 years ago

I'm not sure what path FORGIT_INSTALL_DIR should be but set -x FORGIT_INSTALL_DIR (dirname (dirname (status -f)) seems to effectively be the same thing without needing to cd

wfxr commented 2 years ago

@petertriho Thank you reporting this bug. I reverted this change temporarily in a047bae35a36c26a61b441cebe64b27a45644f3c.

FORGIT_INSTALL_DIR is used for git aliases support. I'm not familiar with fish. I wonder how to execute (cd (dirname (dirname (status -f))); and pwd) in a fish's sub shell so that it will not change the current PWD?

petertriho commented 2 years ago

@wfxr I believe set -x FORGIT_INSTALL_DIR (dirname (dirname (status -f)) will work

wfxr commented 2 years ago

@wfxr I believe set -x FORGIT_INSTALL_DIR (dirname (dirname (status -f)) will work

@petertriho Thank you ! Would you like to send a pr ?

petertriho commented 2 years ago

@wfxr Done!

cjappl commented 2 years ago

Thank you!!