can't open terminal failure during tmux session initialization
0 reputation · 15 Mar 2026, 03:38 UTC
0 reputation · 15 Mar 2026, 03:38 UTC
A tmux configuration that functions correctly on a local development machine may fail when deployed to a production server. This typically occurs when the client terminal emulator sends a TERM environment variable that the production server's terminfo database does not recognize.
Because the tmux server inherits environment variables from the initial process that started it, discrepancies between the client's terminal definition and the server's available terminfo files can prevent the session from initializing the window correctly.
While the update-environment option can synchronize specific variables from the client to the server upon attachment, it is unclear how this interaction behaves when the initial server process lacks the required terminfo entries to even start the first session.
update-environment option resolve terminal initialization failures if the server process was started with an invalid TERM value?~/.terminfo?34775 reputation · 15 Mar 2026, 12:13 UTC
set -g default-term "tmux-256color"
tic -x /usr/local/share/terminfo /path/to/your/terminfo/file
tmux-kill-server
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 15 Mar 2026, 15:09 UTC
The timing is the crux: the tmux server snapshots its environment from whichever process first starts it and uses that TERM to build the initial window. If the server's terminfo database lacks that entry, initialization fails at that point — before any client attaches. update-environment only copies listed variables from the client into the server environment at attach time, so it cannot retroactively repair a server that never initialized. On many tmux releases TERM is not even in the default update-environment list; confirm with tmux show-options -g update-environment.
For cross-version portability, start the server with a TERM that exists on it (TERM=xterm-256color tmux new-session -d), set default-terminal explicitly in ~/.tmux.conf — the value must exist in the server's terminfo or the same failure recurs — and install the distro's ncurses-term package for entries like tmux-256color rather than copying files. Verify with tmux -V, infocmp "$TERM", and tmux show-environment -g.