Skip to content

Instantly share code, notes, and snippets.

@goodell
goodell / tmup
Last active December 31, 2015 23:39 — forked from simonjbeaumont/tmup
A version that deals with the empty line at the end so that it doesn't spew the result of a bare "export". It also splits on newlines instead of commas, so embedded commas in the envvar value won't be misinterpreted.
# adapted from https://gist.github.com/simonjbeaumont/4672606
function tmup() {
local IFS
echo -n "Updating to latest tmux environment...";
export IFS=$'\n';
for line in $(tmux showenv -t $(tmux display -p "#S"));
do
if [[ "$line" == -* ]]; then
unset $(echo $line | cut -c2-);
elif [[ -n "$line" ]] ; then