Skip to main content
added 65 characters in body
Source Link

For example, if I run from window 0:

sleep 2;tmux split-window -h 

and switch to another window 1 with prefix-n before the sleep is over, the window split happens on the new window 1.

How to make the split always happen on window 0 when the command is run from window 0, regardless of the current window?

I have found this possibility:

win="$(tmux display-message -p '#I')";sleep 2;tmux split-window -h -t "$win"

based on: https://superuser.com/questions/385472/get-current-window-number-for-bash-prompt but I don't like it forces me to run an extra command before sleep 2 (which is a real useful command that takes a long time to finish in my use case), which is cumbersome.

Tested on tmux 2.5.

https://groups.google.com/forum/#!topic/tmux-users/ZtEuCZQS_lI

For example, if I run from window 0:

sleep 2;tmux split-window -h 

and switch to another window 1 with prefix-n before the sleep is over, the window split happens on the new window 1.

How to make the split always happen on window 0 when the command is run from window 0, regardless of the current window?

I have found this possibility:

win="$(tmux display-message -p '#I')";sleep 2;tmux split-window -h -t "$win"

based on: https://superuser.com/questions/385472/get-current-window-number-for-bash-prompt but I don't like it forces me to run an extra command before sleep 2 (which is a real useful command that takes a long time to finish in my use case), which is cumbersome.

Tested on tmux 2.5.

For example, if I run from window 0:

sleep 2;tmux split-window -h 

and switch to another window 1 with prefix-n before the sleep is over, the window split happens on the new window 1.

How to make the split always happen on window 0 when the command is run from window 0, regardless of the current window?

I have found this possibility:

win="$(tmux display-message -p '#I')";sleep 2;tmux split-window -h -t "$win"

based on: https://superuser.com/questions/385472/get-current-window-number-for-bash-prompt but I don't like it forces me to run an extra command before sleep 2 (which is a real useful command that takes a long time to finish in my use case), which is cumbersome.

Tested on tmux 2.5.

https://groups.google.com/forum/#!topic/tmux-users/ZtEuCZQS_lI

Post Undeleted by Ciro Santilli OurBigBook.com
Post Deleted by Ciro Santilli OurBigBook.com
added 260 characters in body
Source Link

For example, if I run from window 0:

sleep 2;tmux split-window -h 

and switch to another window 1 with prefix-n before the sleep is over, the window split happens on the new window 1.

How to make the split always happen on window 0 when the command is run from window 0, regardless of the current window?

I have found this possibility:

win="$(tmux display-message -p '#I')";sleep 2;tmux split-window -h -t "$win"

based on: https://superuser.com/questions/385472/get-current-window-number-for-bash-prompt but I don't like it forces me to run an extra command before sleep 2 (which is a real useful command that takes a long time to finish in my use case), which is cumbersome.

Tested on tmux 2.5.

For example, if I run from window 0:

sleep 2;tmux split-window -h 

and switch to another window 1 with prefix-n before the sleep is over, the window split happens on the new window 1.

How to make the split always happen on window 0 when the command is run from window 0, regardless of the current window?

Tested on tmux 2.5.

For example, if I run from window 0:

sleep 2;tmux split-window -h 

and switch to another window 1 with prefix-n before the sleep is over, the window split happens on the new window 1.

How to make the split always happen on window 0 when the command is run from window 0, regardless of the current window?

I have found this possibility:

win="$(tmux display-message -p '#I')";sleep 2;tmux split-window -h -t "$win"

based on: https://superuser.com/questions/385472/get-current-window-number-for-bash-prompt but I don't like it forces me to run an extra command before sleep 2 (which is a real useful command that takes a long time to finish in my use case), which is cumbersome.

Tested on tmux 2.5.

Post Undeleted by Ciro Santilli OurBigBook.com
Post Deleted by Ciro Santilli OurBigBook.com
Source Link

How to split the window that ran the "tmux split-window" command instead of the current one?

For example, if I run from window 0:

sleep 2;tmux split-window -h 

and switch to another window 1 with prefix-n before the sleep is over, the window split happens on the new window 1.

How to make the split always happen on window 0 when the command is run from window 0, regardless of the current window?

Tested on tmux 2.5.