At 16:59 +1200 13 Aug 2013, Jan Larres <j...@majutsushi.net> wrote: >I use this code in zsh to do the same thing without having to patch >tmux. The preexec variable is an array of functions that get called >before each interactive command execution. I don't think such a variable >exists in bash, but you could hack something together with >prompt_command. This way I don't have to ever think about updating the >environment.
I use zsh myself, so I wouldn't need to work around that. Although, as I noted, my main need for updating the environment is with mutt, or more precisely new processes started from there. And those processes get started via the normal sh, not zsh. This is why I use a wrapper around the commands. I could certainly modify my wrapper to parse the current output format, but there would still be the issue below. > VARS="$(tmux show-environment)" > for VAR in ${(f)VARS}; do This will have the problem that I noted in the last paragraph of my previous message, it won't work correctly if the value of an environment variable contains a newline. I know that this is rare, and especially unlikely to happen much with the variables that would typically be listed in the update-environment option; but I'd prefer to be able to handle that just in case. The output format that show-environment command currently uses is completely unsuitable for this. And if a different output format is required I think it makes sense to use a format that is directly useful. ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users