Adding a bit of delay using usleep between the commands (500ms), I seem to
get the expected behavior. So it looks more like some sort of timing issue.
On Fri, Apr 5, 2013 at 1:55 PM, Ashwin G <tuxdude.git...@gmail.com> wrote:
> Thanks Thomas
>
> But using '#{session_name} #{window_index} #{window_name} #{pane_index}'
> gives the exact same behavior.
>
>
> On Fri, Apr 5, 2013 at 1:24 PM, Thomas Adam <tho...@xteddy.org> wrote:
>
>> Hi,
>>
>> The short-form formats aren't supported anymore. Use their longer
>> equivalents.
>>
>> Thomas Adam
>> On 5 Apr 2013 21:20, "Ashwin G" <tuxdude.git...@gmail.com> wrote:
>>
>>> 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
>>>
>>>
>
------------------------------------------------------------------------------
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