Skip to content

Instantly share code, notes, and snippets.

@afresh1
Created May 15, 2013 22:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afresh1/5587835 to your computer and use it in GitHub Desktop.
Save afresh1/5587835 to your computer and use it in GitHub Desktop.
I use this in my .bashrc to update my shell environment from tmux
tmup () {
echo -n "Updating to latest tmux environment...";
local IFS=",";
for line in $(tmux showenv -t $(tmux display -p "#S") | tr "\n" ",");
do
if [[ $line == -* ]]; then
unset $(echo $line | cut -c2-);
else
export $line;
fi;
done;
echo "Done"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment