display-message not displaying the correct values when using send-keys

2013-04-05 Thread Ashwin G
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


Re: display-message not displaying the correct values when using send-keys

2013-04-05 Thread Thomas Adam
Hi,

The short-form formats aren't supported anymore. Use their longer
equivalents.

Thomas Adam
On 5 Apr 2013 21:20, "Ashwin G"  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


Re: display-message not displaying the correct values when using send-keys

2013-04-05 Thread Ashwin G
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  wrote:

> Hi,
>
> The short-form formats aren't supported anymore. Use their longer
> equivalents.
>
> Thomas Adam
> On 5 Apr 2013 21:20, "Ashwin G"  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


Re: display-message not displaying the correct values when using send-keys

2013-04-05 Thread Ashwin G
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  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  wrote:
>
>> Hi,
>>
>> The short-form formats aren't supported anymore. Use their longer
>> equivalents.
>>
>> Thomas Adam
>> On 5 Apr 2013 21:20, "Ashwin G"  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


[PATCH 1/3] Add wait-for command to tmux.vim

2013-04-05 Thread Ben Boeckel
---
 examples/tmux.vim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/tmux.vim b/examples/tmux.vim
index 076115c..e85f8ff 100644
--- a/examples/tmux.vim
+++ b/examples/tmux.vim
@@ -56,7 +56,7 @@ syn keyword tmuxCmds
\ list-buffers loadb load-buffer pasteb paste-buffer saveb save-buffer
\ setb set-buffer showb show-buffer
\ clock-mode if[-shell] lock[-server] run[-shell] server-info info
-   \ choose-list
+   \ choose-list wait-for
 
 syn keyword tmuxOptsSet
\ buffer-limit escape-time exit-unattached exit-unattached quiet
-- 
1.8.1.4


--
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


[PATCH 2/3] Document -o flag to set-window-option in manpage

2013-04-05 Thread Ben Boeckel
---
 tmux.1 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tmux.1 b/tmux.1
index 05dfac6..ea4fdad 100644
--- a/tmux.1
+++ b/tmux.1
@@ -2652,7 +2652,7 @@ The default is
 .Ql \ -_@ .
 .El
 .It Xo Ic set-window-option
-.Op Fl agqu
+.Op Fl agoqu
 .Op Fl t Ar target-window
 .Ar option Ar value
 .Xc
@@ -2661,6 +2661,7 @@ Set a window option.
 The
 .Fl a ,
 .Fl g ,
+.Fl o ,
 .Fl q
 and
 .Fl u
-- 
1.8.1.4


--
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


[PATCH 3/3] Minor whitespace nits

2013-04-05 Thread Ben Boeckel
---
 compat/getopt.c | 2 +-
 layout-set.c| 2 +-
 tmux.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/compat/getopt.c b/compat/getopt.c
index 38c317c..2a60b14 100644
--- a/compat/getopt.c
+++ b/compat/getopt.c
@@ -107,7 +107,7 @@ BSDgetopt(int nargc, char *const *nargv, const char *ostr)
__progname, BSDoptopt);
return (BADCH);
}
-   else/* white space */
+   else/* white space */
BSDoptarg = nargv[BSDoptind];
place = EMSG;
++BSDoptind;
diff --git a/layout-set.c b/layout-set.c
index 646528b..15fe5a6 100644
--- a/layout-set.c
+++ b/layout-set.c
@@ -35,7 +35,7 @@ void  layout_set_tiled(struct window *);
 
 const struct {
const char  *name;
-   void(*arrange)(struct window *);
+   void(*arrange)(struct window *);
 } layout_sets[] = {
{ "even-horizontal", layout_set_even_h },
{ "even-vertical", layout_set_even_v },
diff --git a/tmux.c b/tmux.c
index 8ea91eb..feda59e 100644
--- a/tmux.c
+++ b/tmux.c
@@ -51,7 +51,7 @@ pid_t  environ_pid = -1;
 int environ_session_id = -1;
 
 __dead void usage(void);
-voidparseenvironment(void);
+voidparseenvironment(void);
 char   *makesocketpath(const char *);
 
 #ifndef HAVE___PROGNAME
-- 
1.8.1.4


--
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


[PATCH 0/3] Minor nits in 1.8

2013-04-05 Thread Ben Boeckel
Minor nits I encountered when going over the history for zsh completion script.

Ben Boeckel (3):
  Add wait-for command to tmux.vim
  Document -o flag to set-window-option in manpage
  Minor whitespace nits

 compat/getopt.c   | 2 +-
 examples/tmux.vim | 2 +-
 layout-set.c  | 2 +-
 tmux.1| 3 ++-
 tmux.c| 2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)

-- 
1.8.1.4


--
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