You can set window-size to control which session sets the window size but you can only pick largest, smallest or latest, there is no way to have it pick the oldest session (I don't think this would be hard to add if you wanted). It doesn't resize when you switch focus because simple changing focus does not make a session the latest, it should resize when you type.
If aggressive-resize is on it shouldn't resize unless the sessions share a current window so if you are using different current windows you might want to turn that on. On Fri, 31 May 2024, 03:53 Richard Michael, <rmich...@edgeofthenet.org> wrote: > Hello, > > When I create a second alacritty window (client) with a new tmux > session and new window into an existing session group, tmux resizes > the active window in the first alacritty window (client) to correspond > to the size of the second client's [smaller] active new window. Note, > the first alacritty client itself has not changed size. > > Is there a configuration that can prevent this quirk? > > (So, there are two tmux clients, one session group, two sessions, and > two windows; each client has a different, active window. The scenario > is a lot to describe carefully, so below I've included a "log" with > notes, from a non-tmux terminal window.) > > It seems like an unnecessary resize because if I simply change the > window manager focus back to the first alacritty client window, tmux > automatically corrects (reverts) the size; and, changing focus again, > back to the second window, does not cause [another] resize. i.e., > tmux needn't have resized the window at all, and it doesn't want to on > subsequent focus changes. (I'm wondering if the effect of a SIGWINCH > for the second client is being applied in the first client?) > > > I have not set any window sizing related options, such as > `window-size` or `aggressive-resize`. I've used tmux for many years, > and it handles resizing great with default settings. I did experiment > with these options now, but didn't achieve what I'd hoped. > > > Aside, thanks a lot for tmux, it's indispensable and the code really > is a pleasure to read. > > regards, > richard > ----- > > $ tmux -V ; alacritty -V > tmux 3.4 > alacritty 0.13.2 (bb8ea18) > > $ W_FMT='[s: ${session_name}] w_idx: #{window_index}: > #{window_name}#{window_raw_flags} (#{window_panes} panes) > [#{window_width}x#{window_height}] [layout #{window_layout}] > #{window_id} #{?window_active, (active),}' > > $ while true ; do echo -e "====> $( date +%M:%S )s\n" ; tmux > list-clients \; list-sessions \; list-windows -a -F "${W_FMT}" ; sleep > 2 ; echo -e '\n\n' ; done > > ====> 06:49s > > /dev/ttys001: main [129x76 alacritty] (attached,focused,UTF-8) > main: 1 windows (created Thu May 30 15:06:46 2024) (attached) > [main] w_idx: 1: bash* (1 panes) [129x75] [layout c97d,129x75,0,0,0] > @0 (active) <== will be resized, next > > > > ====> 06:51s > > # `alacritty msg create-window -e tmux new-session -t main \; > new-window` via alacritty keybinding > # window manager auto-focuses new second alacritty client > # tmux resizes original window > > /dev/ttys001: main [129x76 alacritty] (attached,UTF-8) > /dev/ttys003: main-1 [123x46 alacritty] (attached,focused,UTF-8) > main: 2 windows (created Thu May 30 15:06:46 2024) (group main) (attached) > main-1: 2 windows (created Thu May 30 15:06:51 2024) (group main) > (attached) > [main] w_idx: 1: bash* (1 panes) [123x45] [layout c07d,123x45,0,0,0] > @0 (active) <== resized.. > [main] w_idx: 2: bash# (1 panes) [123x45] [layout c07f,123x45,0,0,2] @2 > [main-1] w_idx: 1: bash#- (1 panes) [123x45] [layout c07d,123x45,0,0,0] @0 > [main-1] w_idx: 2: bash* (1 panes) [123x45] [layout c07f,123x45,0,0,2] > @2 (active) <== ..matching this new window > > > > ====> 06:56s > > # change window manager focus back to original alacritty client > # tmux automatically "corrects" (reverts) to the original window size > > /dev/ttys001: main [129x76 alacritty] (attached,focused,UTF-8) > /dev/ttys003: main-1 [123x46 alacritty] (attached,UTF-8) > main: 2 windows (created Thu May 30 15:06:46 2024) (group main) (attached) > main-1: 2 windows (created Thu May 30 15:06:51 2024) (group main) > (attached) > [main] w_idx: 1: bash* (1 panes) [129x75] [layout c97d,129x75,0,0,0] > @0 (active) <== auto-reverted, correct size > [main] w_idx: 2: bash# (1 panes) [123x45] [layout c07f,123x45,0,0,2] @2 > [main-1] w_idx: 1: bash#- (1 panes) [129x75] [layout c97d,129x75,0,0,0] @0 > [main-1] w_idx: 2: bash* (1 panes) [123x45] [layout c07f,123x45,0,0,2] > @2 (active) > > > > ====> 06:58s > > # change window manager focus back to new alacritty window (client), > and sizes remain correct > # i.e., tmux does not shrink the original window again, as it did when > the second alacritty client was created and auto-focused > > /dev/ttys001: main [129x76 alacritty] (attached,UTF-8) > /dev/ttys003: main-1 [123x46 alacritty] (attached,focused,UTF-8) > main: 2 windows (created Thu May 30 15:06:46 2024) (group main) (attached) > main-1: 2 windows (created Thu May 30 15:06:51 2024) (group main) > (attached) > [main] w_idx: 1: bash* (1 panes) [129x75] [layout c97d,129x75,0,0,0] > @0 (active) > [main] w_idx: 2: bash# (1 panes) [123x45] [layout c07f,123x45,0,0,2] @2 > [main-1] w_idx: 1: bash#- (1 panes) [129x75] [layout c97d,129x75,0,0,0] @0 > [main-1] w_idx: 2: bash* (1 panes) [123x45] [layout c07f,123x45,0,0,2] > @2 (active) > > -- > You received this message because you are subscribed to the Google Groups > "tmux-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to tmux-users+unsubscr...@googlegroups.com. > To view this discussion on the web, visit > https://groups.google.com/d/msgid/tmux-users/CABR0jESaRmU43AwNij3S_FeVx6nJD-42HRCR%2BtVAbBjs%3DHHQ-g%40mail.gmail.com > . > -- You received this message because you are subscribed to the Google Groups "tmux-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+unsubscr...@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/CAEdLfcEDnxBzOB%2BP_O8y_NahPMWcdPG0a18YOKkX1j3XL9Q8HA%40mail.gmail.com.