Robert LeBlanc

Sent from a mobile device please excuse any typos.
On Mar 26, 2015 12:41 AM, "Robert LeBlanc" <rob...@leblancnet.us> wrote:
>
>
>
> On Thu, Mar 26, 2015 at 12:31 AM, Robert LeBlanc <rob...@leblancnet.us>
wrote:
>>
>>
>>
>> On Thu, Mar 26, 2015 at 12:13 AM, Benoit Pierre <benoit.pie...@gmail.com>
wrote:
>>>
>>> On Thu, Mar 26, 2015 at 6:53 AM, Robert LeBlanc <rob...@leblancnet.us>
wrote:
>>> > I'm trying to make my .tmux.conf work for both 1.8 and 1.9 while
>>> > depreciating the old syntax. I can't get 1.9 (from Debian) or 1.9a
(compiled
>>> > from source) to work properly. I open a new tmux session and run:
>>> >
>>> > if-shell "[[ `/usr/bin/tmux -V` = *1.9* ]]" "display-message 'Yes'"
>>> > "display-message 'No'"
>>> >
>>> > I always get "No". If I open up tmux on CentOS7 with 1.8 and adjust
the line
>>> > to test for 1.8, I get "Yes" as expected. I get "No" if I change it
to 1.9.
>>> > So it is working just fine in 1.8.
>>>
>>> Are you sure it's not due to different shells and the use of "[[ ]]"
>>> instead of "[ ]" ?
>>>
>>> > dash -c '[[ "`tmux -V`" = *2.0* ]]'; echo $?
>>> dash: 1: [[: not found
>>> 127
>>> > bash -c '[[ "`tmux -V`" = *2.0* ]]'; echo $?
>>> 0
>>>
>>> Also, note the additional double quotes for the call to `tmux -V`.
>>>
>>> Cheers,
>>>
>>
>> My shell is bash, but I'm not sure if tmux executes in my shell or it's
own. I can't get dash to pass, and I don't see a need for the extra double
quotes in bash.
>>
>> rdleblanc@rdleblanc-laptop:/tmp$ tmux -V
>> tmux 1.9
>> rdleblanc@rdleblanc-laptop:/tmp$ dash -c '[ "`tmux -V`" = *1.9* ]'; echo
$?
>> 1
>> rdleblanc@rdleblanc-laptop:/tmp$ bash -c '[[ "`tmux -V`" = *1.9* ]]';
echo $?

>> 0
>> rdleblanc@rdleblanc-laptop:/tmp$ bash -c '[[ `tmux -V` = *1.9* ]]'; echo
$?

>> 0
>>
>> I'm really at a loss. The CentOS box doesn't have dash, so if tmux is
specifically using that, then I can see it as being the problem, but I
would expect that it would us my shell.
>>
>> Thanks,
>> Robert LeBlanc
>>
>
>
> OK, looks like tmux is using dash:
>
> rdleblanc@rdleblanc-laptop:/tmp$ dash -c '[ "`tmux -V`" = "tmux 1.9" ]';
echo $?

> 0
>
> if-shell '[ "`tmux -V`" = "tmux 1.9" ]' 'display-message "Yes"'
'display-message "No"'
>
> works. Now the question shifts to how can I tell tmux to use a certain
shell? I guess I could provide multiple stanzas, one for bash and one for
dash, but that seems like a bad approach and can get unwieldy very quickly.
>
> Any suggestions?
>
> Thanks,
> Robert LeBlanc

It's too late here. The above syntax is POSIX so it should work in bash
just fine. Duh.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to