Byoby Aggressive Resize Error on Iterm2

Bradley Noyes published on
2 min, 363 words

I love tmux and screen and byobu -- which uses screen or tmux as backends -- for terminal work. I suggested these utilities to my co-workers. These are great utilities which allow you ssh into a machine and preserve your ssh sessions even after you log out, or loose your internet connection.

I use iterm2 on my laptop for ssh (in fact, it's the app I spend most of my time using). Iterm2 has integration for tmux so you can open new Iterm2 tabs through a remote tmux session as if there local iterm2 tabs.

But there is a pesky issue in Iterm2 regarding tmux support, the dreaded, aggressive-resize error.

Every time I run into this error, I have to remember how to fix it. Here's how I ended-up fixing it. As the above issue mentions, the option setw -g aggressive-resize off needs to be set, so I append that line to ~/.byobu/profile.tmux, the result is the following.

    noyez@kubuntu18:~$ cat .byobu/profile.tmux 
        	source $BYOBU_PREFIX/share/byobu/profiles/tmux
        	setw -g aggressive-resize off

Then the next time I run byobu -CC ... I get the same error, nuts! This always seems to happen. Then I noticed, I have a bunch of byobu sessions open, which are left over from all my previous failed attempts to get iterm2 and tmux integration working.

    Byobu sessions...
    
      1. tmux: 1: 1 windows (created Thu Dec 27 13:51:57 2018) [80x24]
      2. tmux: 2: 1 windows (created Thu Dec 27 13:52:52 2018) [80x24]
      3. tmux: 3: 1 windows (created Thu Dec 27 13:52:57 2018) [80x24]
      4. tmux: 4: 1 windows (created Thu Dec 27 13:53:02 2018) [80x24]
      5. Create a new Byobu session (tmux)
      6. Run a shell without Byobu (/bin/bash)

So i cleared out all those open sessions, made sure none were running,

    noyez@kubuntu18:~$ byobu list-sessions
    no server running on /tmp/tmux-1000/default

Then next time i ran byobu -CC, I get a new tab in my iterm2 window!