tmux-cluster
tmux-cluster copied to clipboard
tmc <clustername> detaches current session then nothing happens (fish shell)
Mostly posting this as a rubber duck debug method. I plan on posting solution at some point today.
I made a cluster in my ~/.clusterssh/clusters file and try launching with tmc <clustername
and the current session detaches and then I get nothing. The same thing happens with tmc -c "..."
.
I am inside Guake and also using fish shell and have tmux-cluster installed as a tmux plugin and am on master @ f2e19be.
Guake ruled out, happens in normal terminal.
Hrm, if I use tmc -w
to keep it in the current session it goes to window 1 where I have 2 panes, and puts the controller in the right pane and then I control the left pane (which happened to be SSHd into a different server.)
Would be nice if there was a --verbose or --debug flag.
I've never used fish shell before. Does this happen for you in bash as well?
tmux-cluster has a couple of debug-type options. You can print out a list of hosts in the cluster with -d
, and you can print the tmux commands that would have been executed with -t
.
Finally tested this (had to logout to change default shell). It works if I change my default shell and logout/login. Script looks fairly simple so I will try to dig into it and see what is going on. I may just rewrite the script in fish.
Oddly, if I launch bash from within fish (default shell /usr/bin/fish) then nothing happens.
Finally put some time into figuring this out again.
Issue is 2 lines of code it appears:
243: `SHELL_CMD="ssh $HOST; [ \$? -eq 255 ] && (echo Press ENTER to close pane; read enter)"`
246: `SHELL_CMD="ssh $HOST; [ \$? -eq 255 ] && (echo Press ENTER to close pane; read enter)"`
I just needed to change both to
SHELL_CMD="ssh $HOST; [ \$status -eq 255 ]; and (echo Press ENTER to close pane; read enter)"
Because fish uses $status
instead of $?
for the return code of the last command. It also doesn't have &&
and instead uses ; and
or ;and
(same thing).
Maybe we can make a change that checks for the SHELL
that tmc
was invoked from and have a conditional SHELL_CMD
, which would make the script fish compatible.