Skip to content

Instantly share code, notes, and snippets.

@klmr
Forked from simonjbeaumont/tmup
Last active February 6, 2018 13:26
Show Gist options
  • Save klmr/8f0bced3a2735750415b1c59aa47bc2a to your computer and use it in GitHub Desktop.
Save klmr/8f0bced3a2735750415b1c59aa47bc2a to your computer and use it in GitHub Desktop.
Update bash to latest tmux environment on reattaching.
#!/bin/bash
tmup() {
local IFS=$'\n'
for line in $(tmux showenv -t $(tmux display -p '#S')); do
case $line in
-*) unset ${line:1} ;;
*) export $line ;;
esac
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment