I'm marking this as "Fix Released" for groovy since the bug doesn't
happen there because we ship version 3.1b-1.

** Description changed:

+ [Impact]
+ 
+ This is a fix to a problem that happens when the user splits up tmux
+ windows (using 'split-window') while running tmux in the background
+ (i.e., not attached to a pty). In this scenario, tmux should
+ automatically resize the panes and the applications running inside them,
+ but it doesn't.
+ 
+ The cherry-picked fix, which has been pushed upstream already, can be
+ found at:
+ 
+ https://github.com/tmux/tmux/commit/bad95db8785f4ee6b6e17750500c024642e83134
+ 
+ [Test Case]
+ 
+ To reproduce the bug, one can use a slightly modified version of the
+ upstream bug reporter's script.
+ 
+ $ lxc launch ubuntu-daily:focal tmux-bug1875109
+ $ lxc shell tmux-bug1875109
+ # apt update && apt install tmux
+ # cat > reproducer.sh << __EOF__
+ #!/usr/bin/env bash
+ set -euo pipefail
+ 
+ TMUX="tmux"
+ 
+ tmux_cmd() { "${TMUX}" -u -L demo-session "$@"; }
+ msg() { echo -e "\033[1m+ $*\033[m"; }
+ 
+ msg tmux version
+ "${TMUX}" -V
+ 
+ msg starting tmux...
+ tmux_cmd new-session -d -x 80 -y 8 nano --ignorercfiles
+ sleep .5
+ tmux_cmd send-keys -t0 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+ tmux_cmd send-keys -t0 Enter
+ sleep .5
+ 
+ msg 'this is nano at full width:'
+ tmux_cmd capture-pane -pt0
+ 
+ tmux_cmd split-window -ht0 -l 50 sleep infinity
+ sleep .5
+ 
+ msg 'this is nano at smaller width (should have "Modified" + $ at eol):'
+ tmux_cmd capture-pane -pt0
+ 
+ msg 'trying to grep Modified'
+ if ! tmux_cmd capture-pane -pt0 | grep Modified; then
+   msg "@@@@@@@@ BUG DETECTED @@@@@@@@"
+ else
+   msg "@@@@@@@@ NO BUG FOUND @@@@@@@@"
+ fi
+ 
+ msg cleaning up...
+ tmux_cmd kill-pane -t1
+ # quit nano to exit tmux
+ tmux_cmd send-keys -t0 '^X'
+ tmux_cmd send-keys -t0 'n'
+ sleep .5
+ tmux_cmd kill-session >& /dev/null || true
+ __EOF__
+ # chmod +x reproducer.sh
+ # ./reproducer.sh
+ 
+ Look for "@@@@@@@@ BUG DETECTED @@@@@@@@" in the output.
+ 
+ [Regression Potential]
+ 
+ * The fix is extremely simple and self-contained: it teaches tmux to
+ detect whether a window in an unattached session, and resizes it in this
+ case.
+ 
+ * The only "regression" potential I can think of is if tmux's internal
+ state gets confused and mistakenly assumes that a window that is active
+ in an attached session is actually in an unattached session, thus
+ failing to properly resize the window.  This would not be considered a
+ regression, though, since it'd be a latent bug that manifested after
+ this change.
+ 
+ [Original Description]
+ 
  This is the same as this upstream issue:
  https://github.com/tmux/tmux/issues/1963 (fixed 2019-11-02)
  
  this is present in 3.0a-2 for ubuntu focal
  
  there is a patch listed here -- alternatively, it looks like this is
  fixed in 3.1:
  https://github.com/tmux/tmux/issues/1963#issuecomment-548929945

** Changed in: tmux (Ubuntu Groovy)
       Status: Triaged => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1875109

Title:
  regression: splitting panes does not cause a resize in backgrounded
  tmux

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tmux/+bug/1875109/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to