rc: Export $TMPDIR to new tmux processes

`tmux` will start new processes (e.g. when creating panes or windows)
with the same environment it was started with, which means that if the
$TMPDIR variable was overriden for the kakoune server from within
`tmux`, newly created panes/windows won't have access to the server
socket to sustain a session.

This commit fixes the issue by always exporting the $TMPDIR variable
from the parent `tmux` environment to the new processes.

Fixes #1319
This commit is contained in:
Frank LENORMAND 2017-04-09 09:16:56 +03:00
parent 79faae8546
commit b6d055a87b

View File

@ -24,7 +24,7 @@ def -hidden -params 1.. tmux-new-impl %{
tmux_args="$1"
shift
if [ $# -ne 0 ]; then kakoune_params="-e '$@'"; fi
TMUX=$tmux tmux $tmux_args "kak -c ${kak_session} ${kakoune_params}" < /dev/null > /dev/null 2>&1 &
TMUX=$tmux tmux $tmux_args "TMPDIR='${TMPDIR}' kak -c ${kak_session} ${kakoune_params}" < /dev/null > /dev/null 2>&1 &
}
}