xtendo-org / chips

A fast, lightweight, and concurrent plugin manager for the fish shell, written in Haskell
73 stars 3 forks source link

Chips executed with the `--version` argument turns off the fish shell #26

Closed simnalamburt closed 7 years ago

simnalamburt commented 7 years ago

When chips is executed with the --version argument, it turns off the parent fish shell.

xtendo-org commented 7 years ago

Thank you very much for the report.

I've looked into this and found that any argument at all, not only --version, will cause this problem. This is because of the current alias definition we add in ~/.config/chips/build.fish:

alias chips "/home/<username>/.local/bin/chips; exec fish"

Therefore chips --version becomes ...; exec fish --version, and since fish --version will print the fish version and exit immediately, replacing the current shell with exec is equivalent to exiting the shell immediately.

simnalamburt commented 7 years ago

Solved by using function instead of alias

xtendo-org commented 7 years ago

Solved by 7445a38.