Re: Provide command line arguments with arguments

2011-05-28 Thread Micah Cowan
On 05/28/2011 03:28 PM, Helmut Schneider wrote:

> While from a shell you can put single quotation marks around the comman when
> you e.g. put your script into an alias or call it from another script there
> is/seems no way to do that successfully.

Your sentence here doesn't make much sense to me, but I'm going to guess 
that you mean to say that while you can put single quotes around the 
arguments in an interactive shell, you can't do that from an alias or 
"another script".

Which is obviously untrue. It sounds to me like you need to learn to use 
quotes in your shell a bit better. Here are some examples that should 
demonstrate how you might accomplish what you're after.

tmux new '/usr/local/bin/patch_all.sh -H "host1 host2
host3"'

alias foo="tmux new '/usr/local/bin/patch_all.sh -H \"host1 host2
host3\"'

   or

alias foo='tmux new '\''/usr/local/bin/patch_all.sh -H "host1 host2
host3"'\'

(Please excuse the line-wrapping.)

-- 
Micah J. Cowan
http://micah.cowan.name/

--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Provide command line arguments with arguments

2011-05-28 Thread Nicholas Marriott
Please give me an example of exactly what you are trying to do that is
impossible.



On Sun, May 29, 2011 at 12:28:04AM +0200, Helmut Schneider wrote:
> Hi,
> 
> http://www.mail-archive.com/tmux-users@lists.sourceforge.net/msg01037.html
> 
> Has this ever been solved? Here[tm] this is a show stopper.
> 
> Imagine a shell script which takes command line options (e.g. using getopts) 
> and pass that script to tmux:
> 
> [helmut@BSDHelmut ~]$ tmux new /usr/local/bin/patch_all.sh -H "host1 host2 
> host3"
> usage: new-session [-d] [-n window-name] [-s session-name] [-t 
> target-session] [command]
> [helmut@BSDHelmut ~]$
> 
> While from a shell you can put single quotation marks around the comman when 
> you e.g. put your script into an alias or call it from another script there 
> is/seems no way to do that successfully.
> 
> Thanks, Helmut 
> 
> 
> --
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery, 
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now. 
> http://p.sf.net/sfu/quest-d2dcopy1
> ___
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users

--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Provide command line arguments with arguments

2011-05-28 Thread Helmut Schneider
Hi,

http://www.mail-archive.com/tmux-users@lists.sourceforge.net/msg01037.html

Has this ever been solved? Here[tm] this is a show stopper.

Imagine a shell script which takes command line options (e.g. using getopts) 
and pass that script to tmux:

[helmut@BSDHelmut ~]$ tmux new /usr/local/bin/patch_all.sh -H "host1 host2 
host3"
usage: new-session [-d] [-n window-name] [-s session-name] [-t 
target-session] [command]
[helmut@BSDHelmut ~]$

While from a shell you can put single quotation marks around the comman when 
you e.g. put your script into an alias or call it from another script there 
is/seems no way to do that successfully.

Thanks, Helmut 


--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Prefix key preference [Was: Run long commands in Vim]

2011-05-28 Thread Patrick Shanahan
* Chas. Owens  [05-28-11 16:31]:
> snip
> 
> At the very least it clashes with bash's emacs mode C-a command to
> move the cursor to the begging of the line.

yes, it is a great inconvenience to: 


-- 
(paka)Patrick Shanahan   Plainfield, Indiana, USA  HOG # US1244711
http://wahoo.no-ip.orgPhoto Album: http://wahoo.no-ip.org/gallery2
http://en.opensuse.org   openSUSE Community Member
Registered Linux User #207535  @ http://counter.li.org

--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Prefix key preference [Was: Run long commands in Vim]

2011-05-28 Thread Stroller

On 28/5/2011, at 9:28pm, Chas. Owens wrote:
> On Sat, May 28, 2011 at 14:49, Stroller  
> wrote:
>> 
>> On 28/5/2011, at 9:24am, Julien Jehannet wrote:
 ...
 I use CTRL-a, which is the same as screen's prefix key.
 A lot of blogs and introductions to tmux suggest this, so I assumed it was 
 what most people use.
>>> 
>>> But with the same drawback often complained by screen users then.
>> 
>> What drawback would that be, then?
>> 
>> Stroller.
> snip
> 
> At the very least it clashes with bash's emacs mode C-a command to
> move the cursor to the begging of the line.

No problem for me, then!   :)

>From the subject line it seems like the OP might also find Bash's vi-mode 
>keybindings more suitable.   ;)

I find only that one mention of "C-a" in the Bash manpage.

Stroller.
--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Prefix key preference [Was: Run long commands in Vim]

2011-05-28 Thread Chas. Owens
On Sat, May 28, 2011 at 14:49, Stroller  wrote:
>
> On 28/5/2011, at 9:24am, Julien Jehannet wrote:
>>> ...
>>> I use CTRL-a, which is the same as screen's prefix key.
>>> A lot of blogs and introductions to tmux suggest this, so I assumed it was 
>>> what most people use.
>>
>> But with the same drawback often complained by screen users then.
>
> What drawback would that be, then?
>
> Stroller.
snip

At the very least it clashes with bash's emacs mode C-a command to
move the cursor to the begging of the line.

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: if statements in .tmux.conf

2011-05-28 Thread Randy Stauner
I don't know too much about tmux internals but I'm going to take a guess
here:
I think the if-shell command is forking and running asynchronously
and tmux is creating the first window before that command returns and sets
the global option.

Simply setting the option (with -g) does work as expected (without the
if-shell)...
So I tried putting the if-shell line at the very top of my tmux.conf.
I tried doing the same thing with both "set-option -g" and simply
"set-option"...
at first it appeared to work, but on retrying it seemed inconsistent.
 sometimes the first window gets it,
sometimes it doesn't.  a second window usually seems to have it (but not
always...)

I even grep a ps listing to make sure the tmux server is down so that I'm
not getting a cached conf.

I tried putting a "sleep 9;" command in my if-shell and found that my
windows were created as fast as they ever are,
but TERM was set to "screen" (no matter how many windows I created) until 9
seconds had passed.
Then new windows got the new setting.
So it appears that if-shell runs asynchronously even though you may not be
expecting that.
The run-shell command appears to operate the same way.

As a workaround you could put this TERM logic in your bashrc (or rc/profile
for whatever shell you use).
That's where I put it on my pc: I test if the terminfo db supports
screen-256color and then change it.

I could certainly see it being handy to have a synchronous version of (or an
option for) if-shell...

On Sat, May 28, 2011 at 10:38 AM, qwerty asdfg  wrote:

> Hello there.
> I am having issues with the if statements
> I have a line in my .tmux.conf like this:
> if '[ -n $DISPLAY ]' 'set -g default-terminal screen-256color'
> But it only works if I open another window,else the terminal is still
> screen..Is there any way to fix this?
>
>
> --
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> ___
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users
>
>
--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Prefix key preference [Was: Run long commands in Vim]

2011-05-28 Thread Stroller

On 28/5/2011, at 9:24am, Julien Jehannet wrote:
>> ...
>> I use CTRL-a, which is the same as screen's prefix key.
>> A lot of blogs and introductions to tmux suggest this, so I assumed it was 
>> what most people use.
> 
> But with the same drawback often complained by screen users then.

What drawback would that be, then?

Stroller.


--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


if statements in .tmux.conf

2011-05-28 Thread qwerty asdfg
Hello there.
I am having issues with the if statements
I have a line in my .tmux.conf like this:
if '[ -n $DISPLAY ]' 'set -g default-terminal screen-256color'
But it only works if I open another window,else the terminal is still
screen..Is there any way to fix this?
--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Prefix key preference [Was: Run long commands in Vim]

2011-05-28 Thread Jakob Hetzelein
Am 28.05.2011 10:24, schrieb Julien Jehannet:
> 2011/5/28 Stroller :
>>
>> On 27/5/2011, at 5:18pm, Shamaoke wrote:
>>> ...
>>> Then and up to now I've used "Ctrl-x" and, as you know, it clash
>>> with "edit-and-execute-command". Is there any "safe" key?
>>
>> I use CTRL-a, which is the same as screen's prefix key.
>> A lot of blogs and introductions to tmux suggest this, so I assumed it was 
>> what most people use.
> 
> But with the same drawback often complained by screen users then.
> I tend to prefer Control-z for my use since I have few opportunity to
> suspend a tmux/screen session this way.
> 

Well, does someone really use screen and tmux simultaneously? That
doesn’t seem to make sense to me.

I’ve set it to Ctrl-a as well since tmux logically does the same as
screen and I was hitting C-a all the time when being new to tmux, so I
changed it quickly, uninstalled screen and have no clashes here…

Best,
Jakob
-- 
Digital signiert mit PGP-Schlüssel 0x3D23016E




signature.asc
Description: OpenPGP digital signature
--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Prefix key preference [Was: Run long commands in Vim]

2011-05-28 Thread Julien Jehannet
2011/5/28 Stroller :
>
> On 27/5/2011, at 5:18pm, Shamaoke wrote:
>> ...
>> I tackled with it. The problem was that I set the prefix key to "Ctrl-x"
>> and, of course, tmux "ate" it when I tried to run the shortcut. Hence
>> the next question: what is the best prefix key to use with tmux? I used
>> "Ctrl-b" before, but it clash with the bash's "beginning-of-line"
>> action. Then and up to now I've used "Ctrl-x" and, as you know, it clash
>> with "edit-and-execute-command". Is there any "safe" key?
>
> I use CTRL-a, which is the same as screen's prefix key.
> A lot of blogs and introductions to tmux suggest this, so I assumed it was 
> what most people use.

But with the same drawback often complained by screen users then.
I tend to prefer Control-z for my use since I have few opportunity to
suspend a tmux/screen session this way.

--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Run long commands in Vim

2011-05-28 Thread Stroller

On 27/5/2011, at 5:18pm, Shamaoke wrote:
> ...
> I tackled with it. The problem was that I set the prefix key to "Ctrl-x" 
> and, of course, tmux "ate" it when I tried to run the shortcut. Hence 
> the next question: what is the best prefix key to use with tmux? I used 
> "Ctrl-b" before, but it clash with the bash's "beginning-of-line" 
> action. Then and up to now I've used "Ctrl-x" and, as you know, it clash 
> with "edit-and-execute-command". Is there any "safe" key?

I use CTRL-a, which is the same as screen's prefix key.

A lot of blogs and introductions to tmux suggest this, so I assumed it was what 
most people use.

Stroller.
--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users