tmux Said “Not a Terminal.” The Terminal Was Fine
How a misleading tmux error sent us chasing terminal settings—and how we recovered the existing sessions without restarting their server. How a misleading error sent us chasing terminal settings—and how we recovered the existing sessions without restarting their server. I had just updated Ghostty. Then I opened a terminal, typed The timing made Ghostty the obvious suspect. Everything had worked before the update, and now tmux refused to open. But the terminal was fine. The breakthrough came when we stopped looking only at the terminal and started looking at which tmux server the client was talking to. Although attaching failed, listing sessions worked: All my existing sessions appeared, including projects with multiple windows and running processes. That was reassuring, but also confusing: if tmux could find my sessions, why couldn’t it open one? The distinction matters. Listing sessions only requires communication with the server. Attaching also requires the server to accept and initialize the client’s terminal. One can work while the other fails. We initially investigated terminal configuration: Those were hypotheses—not established causes. Several were stated far too confidently during the troubleshooting. Changing Ghostty’s terminal type to We also made an important diagnostic mistake: running terminal checks through a coding agent’s command runner. Those commands ran without an interactive TTY, so their results did not describe the actual Ghostty shell. The useful checks had to run directly in Ghostty: They showed a valid terminal device and confirmed that stdin and stdout were TTYs. Further checks succeeded too: opening the terminal device, reading its attributes, querying its size, and passing its file descriptor between processes. There was no evidence supporting the theory that Ghostty had stopped providing a usable terminal. The most useful test was also one of the simplest: It worked. This command changes two things: It did not restart or modify the server holding my existing sessions. Next, we repeated the experiment with my normal configuration: That worked too, apart from two unrelated configuration warnings. At that point, the problem was much narrower: The current client could start and attach to a fresh server in Ghostty—even with my configuration. Attaching to the existing server was what failed. Running: reported the version of the client executable on disk. It did not tell us the version of the server that had been keeping my sessions alive. To inspect that server, we ran: The important parts of the result were: My existing server was still running tmux 3.5a. Meanwhile, after the troubleshooting upgrades, the client reported Updating an installed executable does not replace a process that is already running. The old server had continued managing my sessions throughout the upgrades. That persistence is useful—but it also means “which tmux version am I using?” can have two answers. Starting a fresh server was a useful diagnostic, but it was not the solution I needed. I wanted access to the work already running in my old sessions. Rather than kill the original server, we built a separate tmux 3.5a client and installed it alongside the newer version: Then we connected it explicitly to the original server: It worked. My old session opened. No server restart. No deleted sessions. No need to recreate the running work. This strongly implicated compatibility between the newer clients and that particular older server. We did not establish the precise internal reason the terminal initialization failed, so claiming a specific protocol bug—or a Ghostty regression—would go beyond the evidence. We did not guess it. The running server reported it: On this machine, the result was: The path breaks down as follows: The Your own path may differ. Ask the server rather than copying this example blindly. If you encounter the same error while existing tmux sessions are still running, this is the sequence I would follow. Do not start with First, check whether they are still available: Different versions do not automatically prove incompatibility, but they are an important clue. Run this directly in your terminal, outside tmux: If it opens, type Success shows that a basic interactive tmux session works in that terminal. It shifts attention toward the existing server or its configuration. Start another named server with your usual configuration file. This helps distinguish configuration problems from problems specific to the original running server. If the old server is running a different version, install a matching client separately and use it to attach through the server’s reported socket path: This avoids replacing or restarting the server during recovery. The Ghostty update was a compelling clue because it happened immediately before the failure. But timing alone did not establish the cause. The decisive evidence was: The error said “not a terminal.” The practical fix was not to change the terminal—it was to use a client that could successfully attach to the server already holding my work.tmux, and got:open terminal failed: not a terminalThe confusing part: my sessions were still there
tmux list-sessionsThe false leads
$TERM incorrect?xterm-256color did not help. Neither did upgrading the tmux client, first to a newer stable release and then to a development build.tty
[ -t 0 ] && echo "stdin: tty"
[ -t 1 ] && echo "stdout: tty"The turning point: a separate server
tmux -L "ghostty-test-$$" -f /dev/null new-session -s test-L selects a separate, named server socket rather than the default one.-f /dev/null starts that server without loading my tmux configuration.tmux -L "ghostty-config-test-$$" \
-f "$HOME/.config/tmux/tmux.conf" \
new-session -s testThere were two different tmux versions
tmux -Vtmux display-message -p \
'server_pid=#{pid} server_version=#{version} socket=#{socket_path}'server_version=3.5a socket=/private/tmp/tmux-501/defaultnext-3.9.Recovering the old sessions
~/.local/opt/tmux-3.5a/bin/tmux~/.local/opt/tmux-3.5a/bin/tmux \
-S /private/tmp/tmux-501/default \
attach-session -t COCKPITWhere did that socket path come from?
tmux display-message -p '#{socket_path}'/private/tmp/tmux-501/default/private/tmp is the macOS temporary directory that /tmp points to.tmux-501 is tmux’s directory for user ID 501.default is the default server socket name.-S option tells a client to use an exact socket path. That made it explicit that the separately installed 3.5a client should connect to the original server.A shorter troubleshooting path
1. Preserve the existing server
tmux kill-server. It terminates the sessions you may be trying to recover, putting their running work at risk.tmux list-sessions2. Compare the client and server versions
tmux -V
tmux display-message -p 'server=#{version} socket=#{socket_path}'3. Test a fresh, isolated server
tmux -L "tty-test-$$" -f /dev/null new-session -s testexit to close the test session.4. Test the normal configuration separately
5. Try a matching client
/path/to/matching/tmux -S /path/to/original/socket attach-sessionThe lesson