Nicholas Marriott <nicholas.marri...@gmail.com> wrote: > Hmm. As far as I can see xterm doesn't set PWD, how come xterm doesn't > have this problem? > > If you make sure your shell exports PWD and add it to > update-environment, tmux will set it in the environment. Does that not > that work? It might be easier to just add PWD to update-environment by > default.
The terminal emulator does not set $PWD afaik but only pass it on, it should have nothing to do with the terminal tmux is run from. My previous example works only if there is a server running already and it was not started from the symlinked directory (i.e. server's PWD is different from /tmp/b). Adding PWD to update-environ works for spawning new sessions but it will break when attaching to an existing session from another path. New windows in this session get the wrong $PWD. Additionally when setting the default-path the user has to set $PWD manually too. And even then windows using remain-on-exit will get the wrong $PWD when respawning. All this should be fixed with this patch. Through all this I realised that tmux new will copy the whole environment when no server is running yet. If a server is running already only the update-environ variables are copied. I find this a bit inconsistent that it makes a difference if a server is already running or not. Wouldn't it make more sense to copy the whole environment for every new session? For example CFLAGS="-Wall -W" tmux does set the CFLAGS variable for the windows in the new session if no server is running but doesn't if a server is running already. ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users