-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Number of columns incorrectly set in speedy mode #157
Comments
@frafra _cmd='stty `tmux display-message -p "rows #{pane_height} cols #{pane_width}"`'
alias xpanes="xpanes -B '${_cmd}'" |
I could repro the issue without #!/bin/bash
## Create new session of tmux
tmux new-session -d -s "my_session" -d "/bin/sh"
## Split window vertically
tmux split-window -v -t "my_session:0" -h -d "/bin/sh"
tmux split-window -v -t "my_session:0" -h -d "/bin/sh"
tmux split-window -v -t "my_session:0" -h -d "/bin/sh"
## Set layout to vertically lined up
tmux select-layout -t "my_session" even-vertical
## Show all pane id
tmux list-panes -t "my_session" -F "#{pane_id}" | while read -r pane_id; do
## Send command to each pane
tmux send-keys -t "my_session.$pane_id" "stty size" C-m
done
## Attach to session
tmux attach-session -t "my_session" |
Open an interactive shell such as /bin/sh, wait a few moments, and the column count will return to normal. #!/bin/bash
## Create new session of tmux
tmux new-session -d -s "my_session" -d "/bin/sh"
## Split window vertically
tmux split-window -v -t "my_session:0" -h -d "/bin/sh"
tmux split-window -v -t "my_session:0" -h -d "/bin/sh"
tmux split-window -v -t "my_session:0" -h -d "/bin/sh"
## Set layout to vertically lined up
tmux select-layout -t "my_session" even-vertical
cmd='printf "%$(tput cols)s\\n" "" | tr " " @'
## Show all pane id
tmux list-panes -t "my_session" -F "#{pane_id}" | while read -r pane_id; do
## Send command to each pane
tmux send-keys -t "my_session.$pane_id" "stty size" C-m
tmux send-keys -t "my_session.$pane_id" "$cmd" C-m
tmux send-keys -t "my_session.$pane_id" "sleep 1" C-m
tmux send-keys -t "my_session.$pane_id" "stty size" C-m
tmux send-keys -t "my_session.$pane_id" "$cmd" C-m
done
## Attach to session
tmux attach-session -d -t "my_session" |
I've tried below workaround, but does not work. #!/bin/bash
## Create new session of tmux
tmux new-session -d -s "my_session" -d "/bin/sh"
## Split window vertically
tmux split-window -v -t "my_session:0" -h -d "/bin/sh"
tmux split-window -v -t "my_session:0" -h -d "/bin/sh"
tmux split-window -v -t "my_session:0" -h -d "/bin/sh"
## Set layout to vertically lined up
tmux select-layout -t "my_session" even-vertical
cmd='printf "%$(tput cols)s\\n" "" | tr " " @'
tmux list-panes -t "my_session" -F "#{pane_id}" | while read -r pane_id; do
##### Adjust new pane size before sending commands
a="$(tmux display-message -t "my_session:0.$pane_id" -p "rows #{pane_height} cols #{pane_width}")"
tmux send-keys -t "my_session.$pane_id" "stty $a" C-m
## Send command to each pane
tmux send-keys -t "my_session.$pane_id" "stty size" C-m
tmux send-keys -t "my_session.$pane_id" "$cmd" C-m
tmux send-keys -t "my_session.$pane_id" "sleep 1" C-m
tmux send-keys -t "my_session.$pane_id" "stty size" C-m
tmux send-keys -t "my_session.$pane_id" "$cmd" C-m
done
## Attach to session
tmux attach-session -d -t "my_session" |
I have no idea if this behavior is a bug in tmux or not. But the fact is that many minor versions of tmux follow this behavior.
|
More insuitive way to reproduce
|
I noticed that just adding
=> Resolved! |
If there are 3 arguments, and the total number of available columns in C, the third pane has
C/2
columns (half the size), the second pane has(2/3)*(C/2)
columns (two-sixth), and the first one has(1/3)*(C/2)
columns (a sixth).This seems to happen only in speedy mode
-s
or-ss
, independently of the layout chosen (but it is easier to view inev
mode).The text was updated successfully, but these errors were encountered: