Anyone else noticing tmux getting worse?

Ey guys,

I've been using sysutil/tmux a long time already but right now I'm seriously considering to move back to Screen because I've just about had it with all the weird stuff that surrounds it. I'm wasting way too much time over this.

It started a few versions back when I began noticing that TMux no longer kept the screen intact. I'm a heavy Midnight Commander user (misc/mc) and every time I'd switch sessions then several lines of the screen would disappear and a quick ^l would make them re-appear again. Slightly annoying, but I figured that it was just some weird change I should look into sometime.

So today I'm setting up a new server (Dell PowerEdge SC1420, should make a really nice BSD server), added my account ("peter") and copied my TMux configuration onto it (~/.tmux.conf). Logged on, started TMux but no configuration (ugly green status bar and it uses ^b vs. my standard ^a). Checked file permissions and all that, nothing.

I did a lot of testing and eventually started all over...

I added 2 new users. One is called peter and the other piet. Other than the name both are identical. Same shell, same group layout (own name + wheel) and both using the exact same .tmux.conf) (copied by root from /root/backup).

Guess what? If piet logs on and starts tmux, all is well. If peter logs on and starts tmux its configuration gets ignored.

I even backtraced it to this (I think):

fcntl(5,F_SETFL,O_RDWR|O_NONBLOCK)               = 0 (0x0)
getpid()                                         = 88089 (0x15819)
__getcwd("/home/peter",1024)                     = 0 (0x0)
ioctl(0,TIOCGETA,0x7fffffffdd50)                 = 0 (0x0)
ioctl(0,FIODGNAME,0x7fffffffdd60)                = 0 (0x0)
close(2147483647)                                ERR#9 'Bad file descriptor'
fcntl(0,F_GETFL,)                                = 2 (0x2)
fcntl(0,F_SETFL,O_RDWR|O_NONBLOCK)               = 0 (0x0)
dup(0x0)                                         = 6 (0x6)
getpid()                                         = 88089 (0x15819)
poll({ 3/POLLIN 5/POLLIN|POLLOUT },2,-1)         = 1 (0x1)
sendmsg(5,0x7fffffffdbf0,0)                      = 113 (0x71)
close(6)                                         = 0 (0x0)
Yet there is nothing wrong with the configuration file.

Then it hit me... what if... I changed my userid from 1001 to 1003 and all of a sudden it worked. So then I re-did my test again, but this time first created user piet (1001) and then peter (1002).

And all was normal.

Concluding: If you use TMux while using a username peter with userid 1001 then its configuration file won't be parsed.

Of course this behavior doesn't seem to be consistent. If I try the exact same thing on a virtual FreeBSD CURRENT (VirtuaBox) and pull in TMux from the repositories then peter/1001 works like a charm.

Either way, I've just about had it with TMux on FreeBSD.
And more testing... hmm, maybe this should be moved to offtopic because it's also a little bit of a rant, though my comment about TMux starting to get messed up is definitely true. I just tested it: Screen has no issues keeping my Midnight Commander screen intact, TMux messes it up completely.

For me this has become a choice of the least worst program.

Screen doesn't grok my ~/.kshrc ($ENV) which ensures that I end up with $ as a prompt instead of my trusty: "
melchior:/home/peter $". TMux does this flawlessly. In order to fix this I'll need to study it.

TMux doesn't preserve my screen correctly, I always need to use ^l to refresh because several (high ascii) lines disappear. Screen preserves my sessions perfectly. However, I'm getting annoyed with seeing 3 entries during a switch (Control-C w) because instead of merely showing me my 2 windows it now insists on showing 3 entries: the tmux session I'm in and both windows in it. SO at first sight you think you're using 3 windows instead of 2.

Some programmers seriously fail to think about the impact of their changes.

Oh well :)
You can try and set
setw -g aggressive-resize on
set -g default-command /usr/local/bin/ksh
Well, it's official, I replaced TMux with Screen again. I've had enough of all the idiocy.

I asked around on some fora and apparently the whole "TMux now also shows sessions with choose-tree" (control-b w) is by design. Just too bad that you now get to see 3 lines when you only have 2 windows open.

I did try to apply a filter to the results, which actually worked, but unfortunately the filter didn't apply to the whole screen but only on the lines within the session "container". So "#{==:#{window_index},>1}" did work, but made no difference.

Alas, the only problem I had with screen was that it didn't set up my environment, or so I thought.

My ~/.kshrc, which gets referenced from .profile (I point $ENV to this file):

if [ "`basename ${0#-}`" == "ksh" ]; then
   set -o posix -o braceexpand -o vi -o vi-tabcomplete;
   PS1="`hostname -s`:\${PWD} \$ ";
I used to merely compare $0 to "-ksh", but once screen is started this gets changed into -/usr/local/bin/ksh. Once I realized as much I changed it to what you see above and from here on screen works just like TMux used to.

It is somewhat of a shame, but it's really difficult to take TMux serious after all this. Not to mention that I wasted more than enough time with it.
I'm not going to attempt to solve your particular issues with it. If screen works for you, so be it. But I just wanted to say that I've been using tmux on FreeBSD for at least 3 years now I think and never had any issues like you have described. It works fine for me and always has done. I suspect it's probably going to be some combination of the terminal used (I use PuTTY on Windows, and Termius on iPhone), the locale used (I use UTF-8), and the .tmux.conf settings. I have many different settings, who knows what half of them do!

I do know that on one of the recent tmux versions they enabled UTF-8 by default and removed the option for enabling it via the config file. I'm wondering if you maybe don't have a UTF-8 terminal/locale and it's this that's causing weird characters to appear.

$ locale

Also in the conf I do this which may also have an effect.

set-option -s default-terminal "screen-256color"
I do know that on one of the recent tmux versions they enabled UTF-8 by default and removed the option for enabling it via the config file. I'm wondering if you maybe don't have a UTF-8 terminal/locale and it's this that's causing weird characters to appear.
Even then it won't solve my biggest gripe: seeing 3 entries during window switching (choose-tree) while I only have 2 windows open. This is version 2.6 by the way. Tried a lot to change that back but without avail. But even if I do manage to fix it I can't help think that it'll be only a matter of time before the next unwanted change will pop up, requiring me to spend even more time trying to reconfigure things, only to eventually find out that my ideas may or may not work. And I'm tired of all that.

Stuff like this is exactly why I stopped using Firefox several years ago: change after change after change, and not all for the better. I can deal with changes, as long as they actually make sense. And like I said: seeing 3 entries on a window switch while I only have 2 to choose from doesn't make sense, it's highly counter productive.

And well, it was a positive impression to seeing Screen not having changed one bit. Not at all. Control-a w, and I see all the sessions I have in the status line for a moment, and only those I actually have. The setuid root part is an annoying one, but at least it actually does what it was designed for.
I've been using Tmux for a couple of years. Whichever version is in the binary packages. I can't say I've noticed any significant changes that impact me but I haven't customized the settings and I only use it to run scripts that are going to take a long time to run.