Hang when trying to attach to tmux on remote FreeBSD

This issue may be similar to #11764

Detailed steps to reproduce the problem:

  1. Configure a profile to connect to a remote machine <remote> -t tmux -CC new -As0
  2. Launch profile

What happened: For my FreeBSD remote, this session opens a new tab and stays there indefinitely. Running tmux -v -CC in the session command shows that the SSH connection never completes.

What should have happened: For my other remotes (Debian is the main one tested), the new window connects and tmux is launched in integration mode properly.

I did try the steps outlined in #11764 once I got the nightly installed... switching \n to \r did not change behaviours so there's something else preventing the connection from happening successfully.

Two other observations:

  1. if I look at a process tree, I can see that iTermServer was called which then started fish (my default shell), then bash, then ssh.
  2. if I open a regular session running fish, then I can call ssh <remote> -t tmux -CC new -As0 successfully. calling it2ssh instead shows the same hung behaviour.