Tmux on lxplus - second part
(this is a sequel to “Tmux on lxplus - first part”, please check it out first!)
Lxplus comes with native tmux installed. However, the native version is 1.8 which is very old. CERN has no plans to update its tmux version, but it is possible to install your own tmux locally (see here).
When using my local tmux, I was running into a strange issue. I was able to create a new session and detach and reattach to it successfully while in the same ssh session. But after logging out of lxplus and then back in, when trying to reattach to the tmux session, I got this error:
open terminal failed: missing or unsuitable terminal: xterm-256color
After a year I have finally traced the problem to the root cause, with this very helpful reference:
The issue is the ‘terminfo database entry can’t be found for “xterm”’. The solution is simple: just export in bash the terminfo location before starting the tmux session:
$ export TERMINFO=/usr/share/terminfo $ cd ~/programs/tmux $ ./tmux new
Then after a new SSH session run the export command again and attach to the tmux session (actually, might not need the export command when reattaching):
$ export TERMINFO=/usr/share/terminfo $ cd ~/programs/tmux $ ./tmux a
You can also just copy the export command to the .bashrc file.
More details about diagnostics: I think the problem might be that I accidentally used some native libraries to compile the local tmux (in /usr/lib/ and /usr/lib64) which was seen from running ‘ldd ./tmux’, though I’m not sure. Could also be that the ncurses version used was different than the local one I downloaded. Not really sure, but in any case exporting the TERMINFO info solves it.