1

I have an old tmux session that when I open it via tmux a -t MySession it has a frozen width:

enter image description here

However, whenever I create a new tmux session, the width can be resized and such 'normally' -- the size only 'freezes' after exiting and re-entering:

enter image description here

Is there a way to prevent this, or to enable resizing the window once again, or do I literally have to delete the tmux session and re-create it to 'recapture' a flexible width?

David542
  • 104,438
  • 178
  • 489
  • 842
  • Do you use any plugin such as tmux-resurrect or something similar that might have been fixing the width for every saved session? Seems like something is interacting with the saved sessions whereas the freshly started ones work fine. – Sohel Aman Jul 06 '20 at 02:18
  • 1
    @SohelAman I'm using ssh into the ubuntu server...and also I set up tmux with `$ tmux -CC new -s 'Session'` -- that is I'm using `iTerm2` to set it up. However, once I set it up in iTerm2, whether I go back into it with `$ tmux -CC a` or just plain `$ tmux a` it gives this same error. – David542 Jul 06 '20 at 22:09
  • 1
    I can't actually guess why the problem should arise suddenly. The only time I had similar issues when I first tried a few plugins to save sessions. If you haven't already, I suggest to take a look at [link 1](https://stackoverflow.com/questions/7814612/is-there-any-way-to-redraw-tmux-window-when-switching-smaller-monitor-to-bigger) [link 2](https://unix.stackexchange.com/questions/218815/tmux-force-resize-window) [link 3](https://superuser.com/questions/880497/how-do-i-resize-the-usable-area-of-a-tmux-session) for some insights. – Sohel Aman Jul 07 '20 at 02:44
  • What does `:list-clients` tell you? Is something else connected? – jeremysprofile Jul 13 '20 at 22:24
  • @jeremysprofile it shows this: https://imgur.com/a/W4dYRcB. Is there a way to disconnect those clients, or how could knowing that be useful? – David542 Jul 17 '20 at 04:08

1 Answers1

3

Based on your <prefix>:list-clients output, you have other clients connected. These sessions can be other users on the system, or clients you accidentally kept active.

These others clients are what's causing tmux to be stuck in a smaller window size. tmux only allows the window size to match the smallest connected client, so that multiple users can access the client at the same time (which is a super useful feature that most people don't take advantage of).

If you don't care about sharing your sessions, you should switch the way you connect to tmux from -t <Session> to -dt <Session>. the -d will disconnect all other clients from your session, allowing your current client to be the only one setting the maximum dimensions.

If you want to disconnect individual clients, use <prefix> D (that's ShiftD, not just d), to view clients, and hit enter when you've highlighted the one you wish to disconnect.

jeremysprofile
  • 10,028
  • 4
  • 33
  • 53
  • thanks for the answer that's great! Is there a way to disconnect a client individually? Or is that not possible. For example in the screenshot I sent it has three clients called "Test [135x45 ]" . – David542 Jul 17 '20 at 17:38
  • 1
    @David542, added that explanation to the answer. – jeremysprofile Jul 17 '20 at 19:46