Accommodate fish shell 2.0.0

This commit is contained in:
Mark Lavi
2015-03-22 00:38:17 -07:00
parent b801aade99
commit 3c37e18987
3 changed files with 13 additions and 5 deletions

View File

@@ -105,7 +105,7 @@ __In fish:__
And add the following to your `~/.config/fish/config.fish` or equivalent: And add the following to your `~/.config/fish/config.fish` or equivalent:
```bash ```bash
eval (tmuxifier init -) eval (tmuxifier init - fish)
``` ```
### Custom Tmux Arguments ### Custom Tmux Arguments

View File

@@ -11,7 +11,10 @@ end
# If `tmuxifier` is available, and `$TMUXIFIER_NO_COMPLETE` is not set, then # If `tmuxifier` is available, and `$TMUXIFIER_NO_COMPLETE` is not set, then
# load Tmuxifier shell completion. # load Tmuxifier shell completion.
if test -n (which tmuxifier); and test -z $TMUXIFIER_NO_COMPLETE 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 end

View File

@@ -76,7 +76,12 @@ case "$shell" in
;; ;;
fish ) fish )
echo "set -gx TMUXIFIER \"$TMUXIFIER\";" 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\";" echo "export TMUXIFIER=\"$TMUXIFIER\";"