tmux open terminal failed: not a terminal

There is an answer already here, but this link I think summarises it better. In a nutshell, use the -t flag:

ssh -t host tmux attach

If you want to set it into your .ssh/config file, look in the ssh_config manpage for the RequestTTY option:

 RequestTTY
         Specifies whether to request a pseudo-tty for the session.  The
         argument may be one of: ``no'' (never request a TTY), ``yes''
         (always request a TTY when standard input is a TTY), ``force''
         (always request a TTY) or ``auto'' (request a TTY when opening a
         login session).  This option mirrors the -t and -T flags for
         ssh(1).

Leave a Comment