Thanks for your suggestion.  I think that was my second-best option, but 
it's still more complicated than using env.  It would require iterating 
over the "set-environment" command a number of times since it only takes 
a single var per invocation.



On 6/3/14, 7:57, Nicholas Marriott wrote:
> Create the session, set the options, create a new window, kill window 
> 0 then move the new window to 0 (or movew -k or movew -r).
>
>
> -------- Original message --------
> From: Jesse Molina <je...@opendreams.net>
> Date: 02/06/2014 03:23 (GMT+00:00)
> To: tmux-users@lists.sourceforge.net
> Subject: Re: Need tmux to inherit and pass on environment to a subshell
>
>
>
> I think, ultimately, my problem comes down to not being able to
> configure tmux session or window options during initialization except
> from a configuration file via -f.
>
> The user can't specify options to a new-session or new-window, within
> the command itself, until after it has been created, which is too late.
>
> set-option can't be used until after the shell-command has been executed.
>
> My best choices at this time seem to be a "env $VARS command" as the
> shell-command, or write a custom tmux config and source it with -f on
> the fly.
>
> It's not as if I can modify the program I am running to not take it's
> configuration from the environment.
>
> Please disagree with me if someone sees a better solution here that I 
> don't.
>
>
> On 6/1/14, 17:41, Jesse Molina wrote:
> > Thanks for the suggestion. This was pretty close to what I was already
> > doing as a hack.
> >
> > I have a lot of variables, and many of them have spaces. printenv/env
> > doesn't output quoted values, so I have to alter the output further from
> > there and generate a huge command list.
> >
> > I don't understand why tmux is a brick wall between these processes when
> > the need to do this seems really obvious. Environmental variables are
> > right up there with stdin. It's like not being able to pass arguments to
> > a command.
> >
> > It's easy to find a large number of user problems with both tmux and
> > screen where tmux/screen is being a brick wall between processes. People
> > are writing their input to text files and pipes to read them into the
> > command pipeline and doing other nonsense to get around this:
> >
> > 
> https://superuser.com/questions/105954/updating-screen-session-environment-variables-to-reflect-new-graphical-login
> >
> > Is this an obvious badly-needed feature, or am I not taking something
> > into consideration?
> >
> > I would suggest a command option to new-session/new-window where the
> > user can list a series of vars which tmux will pass on to the new
> > process.  tmux already does this with certain special variables.
> >
> > I' 


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to