If I start a new session in the background, and use send-keys to run
`display-message`, I seem to get incorrect values for #I, #W, and #P.

For example the following sample set of commands:

session_name="TEST"
# Window 0tmux new-session -d -s "$session_name" -n "Window_0"tmux
send-keys -t "$session_name":0 "tmux display-message -p '#S #I #W #P'"
Entertmux split-window -htmux send-keys -t "$session_name":0 "tmux
display-message -p '#S #I #W #P'" Enter

# Window 1tmux new-window -t "$session_name" -n "Window_1"tmux
send-keys -t "$session_name":1 "tmux display-message -p '#S #I #W #P'"
Entertmux split-window -htmux send-keys -t "$session_name":1 "tmux
display-message -p '#S #I #W #P'" Enter

# Attach the sesssiontmux -2 attach-session -t "$session_name"


produces the output:

Window 0 Left Pane: TEST 0 Window_0 0Window 0 Right Pane: TEST 0
Window_0 1Window 1 Left Pane: TEST 1 Window_1 0Window 1 Right Pane:
TEST 1 Window_1 1


when it should be instead giving this output:

Window 0 Left Pane: TEST 1 Window_1 1Window 0 Right Pane: TEST 1
Window_1 1Window 1 Left Pane: TEST 1 Window_1 1Window 1 Right Pane:
TEST 1 Window_1 1


It somehow looks like the commands are not executed until a client attaches
to the session. Not sure if this is the expected behavior. So I've filed a
bug for this as well.

https://sourceforge.net/p/tmux/tickets/39/
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to