When I resize a terminal window containing a tmux session, tmux doesn't detect this change, but continues to function normally within the old window boundaries. tmux ls shows no other attached clients before I attach:

$ tmux ls
admin: 1 windows (created Mon Apr 27 15:12:58 2015) [272x75]
apt-runs: 3 windows (created Mon Apr 27 15:17:50 2015) [272x75]
lal-dev: 4 windows (created Tue Jun  9 12:24:25 2015) [238x73]

This only happens with a particular host (running tmux 1.9a), and detaching/reattaching fixes the issue (until the window is resized again). What might be causing this?

Before resize: Before

After resize: enter image description here

  • 3
    Is there another terminal window attached to that session that limits the size? – Anthon Jun 16 '15 at 11:06
  • @Anthon Nope – tmux ls shows no other clients. I've clarified this in the question. – Will Vousden Jun 16 '15 at 11:17
  • I'm experiencing this issue; Noteworthy is that we're both on OSX although I'm probably running a more up-to-date version. Have you found any fix, seeing as there is no accepted answer? – SidOfc Sep 19 '17 at 14:45

I'm not well-versed in terminal lingo, but I managed to get-rid of this bug by doing the following steps:

  1. leave the session by pressting Ctrl+b d (don't worry, you can return to the session completely in-tact)

  2. Check if your console application is running xterm. if echo $TERM returns xterm then this procedure might work for you.

  3. type resize into your terminal.

  4. return to your session by re-invoking tmux, as you can see, all of your sessions are running like you never left tmux at all.

Tmux links it's terminal size with your xterm 'size' variable. If you happen to have your $TERM set to screen, then I can't help you, since I don't know what the commands are for that TERM session.

  • 1
    Going that route, you'll have to do this each time you resize the window. That's exactly what OP stated they did, in the question. – Thomas Dickey Aug 5 '16 at 20:19
  • 1
    Invoking resize (after apt install xterm) was the crucial step I was missing. – ulidtko Sep 27 '18 at 14:19

The easiest thing to do is to detach any other clients from the sessions when you attach:

tmux attach -d

or short

tmux a -d

Alternately, you can move any other clients to a different session before attaching to the session: https://stackoverflow.com/a/7819465/1069083

  • Like I said in the question, there were no other clients. Unlike this case, when there are multiple clients with different terminal sizes, the status bar remains at the bottom of the screen, and the unused area is filled in with dots. I never solved this problem, but I no longer work on the system where it occurred. – Will Vousden Jul 18 '18 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.