I SSH onto remote machines a lot during work, and I use tmux to keep tasks running on the server even after client disconnection. But honestly, tmux is not easy to use. Anyway, if you don't need remote session persistence, why would anyone use tmux when many terminal emulators, like Kitty, provide more and better features? Many tmux users have a frustrating experience setting up colors, mouse support, scrollback, etc., especially before the agent era, when answers were found by visiting dozens of Stack Overflow posts.
Even with tmux properly set up, the experience is still different from the local experience. For example, you can't have smooth scrolling for tmux, which always drives my brain crazy when working with the trackpad. Another example is copying. To copy text from tmux, I use two options. If the text is short and spans less than a page, I press Shift and select it so that the selection bypasses tmux and is interpreted by the terminal directly, which I have configured to copy on selection. However, if the text chunk is large, I have to use the tmux way, namely select in tmux and copy, going through OSC52. Functionally speaking, tmux copy works fine, but the experience of text selection is, of course, worse than that of a naive terminal. Sometimes it does not fully follow the mouse, and sometimes it's laggy.
But Rex demonstrated another approach. Instead of having a translation layer like tmux sitting in the middle, the Rex server directly holds the PTY and sends it to the client. Remember that all the frustrations we experienced with tmux are because of the imperfect translation layer! With the Rex architecture, the remote SSH experience is essentially the same as the local experience or running the ssh command directly in your terminal, but the terminal stays alive even after you go offline or turn off the computer. This is a huge advantage.
Besides, Rex is mainly developed by Mitchell Hashimoto, the man behind Ghostty. In case you don't know the story behind Ghostty, it's not just another terminal emulator. Terminal emulation is challenging to get right, and the authors managed to create a common library libghostty-vt which is powering the JetBrains IDE and a bunch of new things, like KDE's new terminal emulator, Kwi.
Rex is currently in beta, and you can join the waitlist via https://www.superlogical.com/updates/public-testing-beginning, or find download links directly at https://linux.do/t/topic/3050563/32.
However, it does come with some limitations. Currently, it's not open source, and the client is only available on macOS. It also requires the Rex server running on the remote host. Somehow the Rex documentation recommends using Tailscale HTTP or similar things to reach the remote Rex server, but traditional SSH access is also supported without port forwarding. To set it up, assuming my-devbox is already in your ~/.ssh/config, you can run the following commands:
rex server install ssh://my-devbox # Or follow the documentation
rex -S ssh://my-devbox whoami # Test connection
rex hosts add "My Devbox" ssh://my-devboxRex has the concept of "sessions," which can be understood as a group of tabs. You can have many sessions for each host, either local or remote, but currently it can't mix local and remote tabs in the same session.
Besides, you can only change the default shell for local sessions. To change the remote default shell to something other than the login shell, we need some hacks. Specifically, put the following file at ~/.local/bin/getent or similar directories, which can override the system-wide one:
#!/bin/sh
if [ "$1" = "passwd" ] && [ "$(cat "/proc/$PPID/comm" 2>/dev/null)" = "rex" ]; then
/usr/bin/getent "$@" | sed "s|:/bin/bash$|:/usr/bin/fish|"
exit $?
fi
exec /usr/bin/getent "$@"where /bin/bash is the current login shell and /usr/bin/fish is the shell you want to use.
And if you have a server shared with others, Rex does not work as smoothly as SSH+tmux. It requires nontrivial setups.
However, for me, Rex is quite usable as my daily driver for work. The limitations aren't really blockers, and the app is already doing an excellent job, not to mention that it's currently in a beta phase. Really excited to see the future updates for Rex.