The tmux TODO list has this item:

* use "--" to mark start of command w/ neww etc to avoid quoting


I'm a little confused about this, so I'm hoping to get some
clarification.  In this email:

http://article.gmane.org/gmane.comp.terminal-emulators.tmux.user/5432


...the user gets a usage error with the example command "tmux
new-session -- true --zupa --sometest" and he seems to think that he's
getting the usage error because tmux or new-session is seeing "--zupa"
and "--sometest" as invalid flags.  He wants tmux to be modified so
the "--" separates his command's flags from those of new-session.

Does this match the intended purpose of the TODO item?  If not, then
could you give some more detail on what is wanted?

If this does match the intended purpose, then I think the problem has
been misdiagnosed.  The usage error that the user got doesn't appear
to be because of his flags being interpreted by new-session, but
because, by not putting them in quotes, he was passing 3 args to
new-session, and new-session has args_upper set to 1.

If the goal is to get new-session to take more than 1 arg so that
commands don't need to be quoted, isn't using "--" the wrong way to
go?  I thought getopt consumes "--", so that cmd_new_session_exec()
would never see it, and so couldn't alter its behavior.  Wouldn't you
have to modify getopt() or args_parse() to pass "--" along to
new-session?

If that's not desirable, then new-session could be modified to not
need quotes by default, but this would break any existing scripts
people have.  Alternatively, a different flag (-m for multi-arg?)
could be used to signal that the command args aren't quoted.  Do you
care for either of those options?

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to