Activity log for bug #1976110

Date Who What changed Old value New value Message
2022-05-27 18:09:21 Anthony Sottile bug added bug
2022-06-03 09:18:44 Utkarsh Gupta tmux (Ubuntu): status New Triaged
2022-06-03 09:18:54 Utkarsh Gupta tmux (Ubuntu): importance Undecided Medium
2022-06-03 09:19:00 Utkarsh Gupta tmux (Ubuntu): assignee Utkarsh Gupta (utkarsh)
2022-06-03 09:21:29 Utkarsh Gupta tags bitesize server-todo
2022-06-05 01:55:14 Launchpad Janitor tmux (Ubuntu): status Triaged Fix Released
2022-06-09 18:44:53 Bryce Harrington nominated for series Ubuntu Jammy
2022-06-09 18:44:53 Bryce Harrington bug task added tmux (Ubuntu Jammy)
2022-06-09 18:45:05 Bryce Harrington tmux (Ubuntu Jammy): status New Triaged
2022-06-09 18:45:08 Bryce Harrington tmux (Ubuntu Jammy): importance Undecided Medium
2022-06-11 19:25:46 Utkarsh Gupta tmux (Ubuntu Jammy): assignee Utkarsh Gupta (utkarsh)
2022-11-01 13:38:41 Robie Basak bug added subscriber Ubuntu Server
2022-11-23 12:22:52 Utkarsh Gupta description source package: https://packages.ubuntu.com/en/source/jammy/tmux this was a bug in tmux 3.2a -- it has since been fixed on tmux master here is my system information: ```console $ dpkg -l | grep tmux ii tmux 3.2a-4build1 amd64 terminal multiplexer $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04 LTS Release: 22.04 Codename: jammy ``` you can reproduce this pretty easily with: ```bash tmux -V tmux new-session -d -x 20 -y 20 bash tmux send-keys 'tput cols' tmux send-keys 'Enter' sleep 1 tmux capture-pane -pt0 | grep -Eo '^[0-9]+' tmux kill-session ``` on 20.04, I get the following: ```console $ bash t.sh tmux 3.0a 20 ``` on 22.04 I get the following (my parent window is 118 wide): ```console $ bash t.sh tmux 3.2a 118 ``` I've gone ahead and bisected to find the patch that's needed to fix this -- it was originally committed here: https://github.com/tmux/tmux/commit/df3fe2aa72da0555106c6187e750418f0e59d901 applying that to the packaging of 3.2a should be pretty straightforward, I've verified that applying it fixes the problem: ```console $ git checkout 3.2a $ git cherry-pick df3fe2aa72da0555106c6187e750418f0e59d901 $ ./autogen.sh >& /dev/null && ./configure --prefix=$PWD/prefix >& /dev/null && make -j5 >& /dev/null && make install >& /dev/null && PATH=/tmp/tmux/prefix/bin:$PATH bash ../t.sh tmux 3.2a 20 ``` so all that should be needed is to apply that patch: ```diff commit df3fe2aa72da0555106c6187e750418f0e59d901 (refs/bisect/skip-df3fe2aa72da0555106c6187e750418f0e59d901) Author: Nicholas Marriott <nicholas.marriott@gmail.com> Date: Tue Jul 13 10:38:57 2021 +0000 Only use client for sizing when not detached, GitHub issue 2772. diff --git a/cmd-new-session.c b/cmd-new-session.c index 666aeaac..033c707f 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -280,7 +280,8 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) memset(&sc, 0, sizeof sc); sc.item = item; sc.s = s; - sc.tc = c; + if (!detached) + sc.tc = c; sc.name = args_get(args, 'n'); sc.argc = args->argc; ``` thanks! [Impact] ======== I use tmux for testing a CLI app on different terminal sizes. I noticed that after upgrading to 3.2a from 3.2, the -x and -y parameters I pass to tmux new-session -d does not take effect. The below command outputs are from terminals with the same size: $ tmux -V tmux 3.2a $ rm bar; tmux new-session -d -x 20 -y 10 'tput cols > bar'; sleep 0.1; cat bar 174 $ tmux -V tmux 3.2 $ rm bar; tmux new-session -d -x 20 -y 10 'tput cols > bar'; sleep 0.1; cat bar 20 Also, the default size has also changed, where 3.2 always spawns a detached window of width 80 regardless of the terminal size, however 3.2a uses the width of the terminal I used to spawn it. [Test Plan] =========== You can reproduce this pretty easily with: $ lxc launch images:ubuntu/jammy jtemp --vm # apt upadte && apt install tmux ### change to a user - not really needed but I have a user configured. $ tmux -V $ tmux new-session -d -x 20 -y 20 bash $ tmux send-keys 'tput cols' $ tmux send-keys 'Enter' $ sleep 1 $ tmux capture-pane -pt0 | grep -Eo '^[0-9]+' $ tmux kill-session on 20.04, I get the following: ```console $ bash t.sh tmux 3.0a 20 ``` on 22.04 I get the following (my parent window is 118 wide): ```console $ bash t.sh tmux 3.2a 118 ``` [Regression Potential] ====================== There might be a corner case where a user might face a regression if they have done some workarounds to this issue but that should be really minimal (if not zero). The patch is really trivial and is really targeted (see the if clause) so the chances of actual regression is also really minimal. [Other Information] =================== I've gone ahead and bisected to find the patch that's needed to fix this -- it was originally committed here: https://github.com/tmux/tmux/commit/df3fe2aa72da0555106c6187e750418f0e59d901 applying that to the packaging of 3.2a should be pretty straightforward, I've verified that applying it fixes the problem: ```console $ git checkout 3.2a $ git cherry-pick df3fe2aa72da0555106c6187e750418f0e59d901 $ ./autogen.sh >& /dev/null && ./configure --prefix=$PWD/prefix >& /dev/null && make -j5 >& /dev/null && make install >& /dev/null && PATH=/tmp/tmux/prefix/bin:$PATH bash ../t.sh tmux 3.2a 20 ``` so all that should be needed is to apply that patch: ```diff commit df3fe2aa72da0555106c6187e750418f0e59d901 (refs/bisect/skip-df3fe2aa72da0555106c6187e750418f0e59d901) Author: Nicholas Marriott <nicholas.marriott@gmail.com> Date: Tue Jul 13 10:38:57 2021 +0000     Only use client for sizing when not detached, GitHub issue 2772. diff --git a/cmd-new-session.c b/cmd-new-session.c index 666aeaac..033c707f 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -280,7 +280,8 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)         memset(&sc, 0, sizeof sc);         sc.item = item;         sc.s = s; - sc.tc = c; + if (!detached) + sc.tc = c;         sc.name = args_get(args, 'n');         sc.argc = args->argc; ``` thanks!
2022-11-23 12:24:31 Launchpad Janitor merge proposal linked https://code.launchpad.net/~utkarsh/ubuntu/+source/tmux/+git/tmux/+merge/433522
2022-12-01 14:55:29 Andreas Hasenack tmux (Ubuntu Jammy): status Triaged Fix Committed
2022-12-01 14:55:31 Andreas Hasenack bug added subscriber Ubuntu Stable Release Updates Team
2022-12-01 14:55:33 Andreas Hasenack bug added subscriber SRU Verification
2022-12-01 14:55:37 Andreas Hasenack tags bitesize server-todo bitesize server-todo verification-needed verification-needed-jammy
2022-12-01 15:24:00 Utkarsh Gupta tags bitesize server-todo verification-needed verification-needed-jammy bitesize server-todo verification-done-jammy verification-needed
2022-12-13 21:11:15 Launchpad Janitor tmux (Ubuntu Jammy): status Fix Committed Fix Released
2022-12-13 21:11:23 Brian Murray removed subscriber Ubuntu Stable Release Updates Team