I forgot about tmux!

I've only been working with *NIX for over 35 years, and it's only I'm just NOW have I realized that I forgot to stop and learn tmux. Now that I have, I don't think I'll ever go back. No wonder why it's been around for so long. It's super handy, though required some light configuration to ensure that it hangs onto my ssh-agent properly.

Here's some notes on how I got it working properly with my ssh-agent on Ubuntu, in case anybody would find it helpful.

Example #1 - Add to tmux.conf:

# Get SSH_AUTH_SOCK from the current environment by default
set -g update-environment "SSH_AUTH_SOCK SSH_CONNECTION"

Example #2 - Add to .bash_profile:

# You can find this code at https://github.com/wwalker/ssh-find-agent
# (update this path to the correct location on your system)

source ~/bin/ssh-find-agent.sh
function prompt_command() {
if [ -n "${TMUX}" ]; then
    eval"$(tmux show-environment -s)"
else
    ssh-add -l >&/dev/null || ssh-find-agent -a || eval$(ssh-agent) > /dev/null
fi
)
PROMPT_COMMAND=prompt_command