On Wed, Dec 15, 2010 at 03:19:45PM -0500, Lars Kellogg-Stedman wrote:
> > Someone suggested treating the rest of the command line as one argument
> > if -- is encountered, I'd be happy with that.
> 
> Why require "--"?  Looking at the man page:
> 
>   new-window [-adk] [-n window-name] [-t target-window] [shell-command]
> 
> ...why is it necessary to terminate the arguments with "--"?  That is,
> I'm not sure I see a situation in which there is any ambiguity as to
> which arguments belong to new-window and which belong to the external
> command.  If you simply stop processing options at the first
> non-option argument, you're all set (and then treat all remaining
> arguments as the command).  Ideally, you'd preserve the shell's
> tokenization of the command line, rather than concatenating everything
> into a single string first.

Actually thinking about it I can't remember if there was a big problem.

We'd have to pass argv/argc around internally to represent a shell
command or an unparsed tmux command; it'd probably be better, but might
need quite a few changes.

The reason we don't do that now is that %% substitution is much easier
when the command is a single string rather than vector.

So all commands that take a command or shell-command would have to take
the trailing arguments and store them (we have cmd_copy_argv etc so this
wouldn't be hard) instead of storing a string. And %% substitution would
have to be rewritten to work on an argv.

It'd break most existing configs.

Advantage is it would finally make everything consistent with bind-key.

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to