diff --git a/README.md b/README.md index a71d30a..bce412c 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ __In fish:__ And add the following to your `~/.config/fish/config.fish` or equivalent: ```bash -eval (tmuxifier init -) +eval (tmuxifier init - fish) ``` ### Custom Tmux Arguments diff --git a/init.fish b/init.fish index 1fa2f6f..78d4628 100644 --- a/init.fish +++ b/init.fish @@ -11,7 +11,10 @@ end # If `tmuxifier` is available, and `$TMUXIFIER_NO_COMPLETE` is not set, then # load Tmuxifier shell completion. if test -n (which tmuxifier); and test -z $TMUXIFIER_NO_COMPLETE - source "$TMUXIFIER/completion/tmuxifier.fish" + # fish shell 2.0.0 does not have the source alias + if [ (fish --version 2>| awk -F'version ' '{print $2}') = '2.0.0' ]; + . "$TMUXIFIER/completion/tmuxifier.fish" + else + source "$TMUXIFIER/completion/tmuxifier.fish" + end end - - diff --git a/libexec/tmuxifier-init b/libexec/tmuxifier-init index ad0eab3..0bad316 100755 --- a/libexec/tmuxifier-init +++ b/libexec/tmuxifier-init @@ -76,7 +76,12 @@ case "$shell" in ;; fish ) echo "set -gx TMUXIFIER \"$TMUXIFIER\";" - echo "source \"\$TMUXIFIER/init.fish\";" + # fish shell 2.0.0 does not have the source alias + if [[ $(fish --version 2>&1 | awk -F'version ' '{print $2}') = '2.0.0' ]]; then + echo ". \"\$TMUXIFIER/init.fish\";" + else + echo "source \"\$TMUXIFIER/init.fish\";" + fi ;; * ) echo "export TMUXIFIER=\"$TMUXIFIER\";"