これがしたいんだけど、fish scriptがアレすぎて「bash script to fish script」とかでググり続けた結果…。
fishermanから
https://github.com/fisherman/fisherman
bass入れて
fisher edc/bass
vim ~/.config/fish/functions/tmux.bash.sh
tmux.bash.sh
if [[ ! -n $TMUX && $- == *l* ]]; then
# get the IDs
ID="`tmux list-sessions`"
if [[ -z "$ID" ]]; then
tmux new-session
fi
create_new_session="Create New Session"
ID="$ID\n${create_new_session}:"
ID="`echo $ID | $PERCOL | cut -d: -f1`"
if [[ "$ID" = "${create_new_session}" ]]; then
tmux new-session
elif [[ -n "$ID" ]]; then
tmux attach-session -t "$ID"
else
: # Start terminal normally
fi
fi
という感じでそのままコピペして…
chmod 755 ~/.config/fish/functions/tmux.bash.sh
権限あげたら
vim ~/.config/fish/config.fish
config.fish
bass ~/.config/fish/functions/tmux.bash.sh
source ~/.config/fish/config.fish
動いた。
教訓
fishで動かないものはbassにsh投げろ