Search code examples
sshtmuxurxvt

can not open tmux session over ssh with `urxvt -e`


when I run this command urxvt -e ssh -t my-remote-server tmux new -As default-session in rofi, urxvt will come out, and exit immeditelly.

the question is: how can I keep urxvt window alive with above situation?

I have tried those, and them all work well.

  • ssh -t my-remote-server tmux new -As default-session # will attach in the session, unless I detach from the session, this command will not exit.
  • urxvt -e ssh -t my-remote-server tail -f /dev/null

I tried to use alacritty, it works well


Solution

  • I found the cause: inapproriate TERM env

    so the command should be: ssh -t my-remote-server TERM=xterm-256color tmux new -As default-session

    another thing to know, remote server must have the TERM type (using in the above command) in /usr/share/terminfo (usualy in there)