I made a major overhaul to bash and bash config files. Afterwards, I started getting flaky behavior and warnings when trying to reload bash configs in tmux sessions that were spawned on an older bash configuration. So I did:

exec -c /bin/bash/env bash

in one of the sessions. Which helped, but now I'm getting still getting other odd behavior. For example, when I do clear I get an error:

TERM environment variable not set.

How do I cleanly load my new bash configuration and environment into these old sessions?

  • In case you don't find a cleaner solution, you could try installing tmux-resurrect plugin, loading it into your tmux session, saving, then killing your session, and restoring...? – PlasmaBinturong Mar 27 at 17:14
  • 1
    Or what about a tmux synchronize-panes and then source ~/.bashrc? – PlasmaBinturong Mar 27 at 17:19
  • Yeah, I do have tmux-resurrect. I try to avoid it, though, as my vim sessions are always a mess and I have to refresh windows individually. Haven't gotten around to perfecting that yet. – StevieD Mar 27 at 17:24
  • Not familiar with synchronize-panes. I will look into that. Thanks. – StevieD Mar 27 at 17:25

To be honest if you have made major changes to your shell profiles and want them to apply to all existing shells, the best thing to do is restart tmux entirely.

  • Yeah, that's what I ended up doing. – StevieD Mar 28 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.