3

I did the following to try and get Byobu to work (see https://stackoverflow.com/questions/19099018/byobu-error-sessions-should-be-nested-with-care-unset-tmux-to-force ) on a Ubuntu server droplet I rent from Digital Ocean but it didn't fix my problem.

TMUX= ''

I would now like to revert it to it's original setting but do not know what the default should be. Is anyone able to advise?

I'm hoping I am correct in thinking this is the appropriate location to post this even though the original question I link to above is from the StackOverflow site.

1 Answer 1

3

Logging in again should get you the value back in the new session. If you did this in a sub-shell, exiting the sub-shell should reveal the original value. You may be able to find the original value with grep. Try the commands:

grep TMUX= ~/.??*
find /etc -type f | xargs grep TMUX=

Setting $TMUX='' may create an empty variable with the name specified by the TMUX variable. The commands TMUX='' or unset TMUX will clear the TMUX variable. The command echo TMUX=\"$TMUX\" will echo a command you can use to restore the value to its current value.

When doing this kind of thing I recommend creating a backup variable like this:

TMUX_OLD="$TMUX"
$TMUX=''

You can then restore the value with the command:

TMUX="$TMUX_OLD"

EDIT: It may be possible to find the correct value in the environment of the parent process. This may be readable using the command:

cat /proc/$PPID/environ | tr '\0' '\n'
8
  • Sorry I have edited my question, I did not use the dollar sign when entering the original command so I did in fact un-set the TMUX variable. In which case, am I right in thinking I just need to enter the command returned from your "echo..." suggestion? Or can I just do TMUX=\"$TMUX\" without having to replace $TMUX with its actual value? Commented Jan 2, 2014 at 14:34
  • @drewstiff just open a new terminal, the command you ran should only have affected the shell you had opened. Commented Jan 2, 2014 at 14:51
  • If I end my session and re-start it and I try the command BYOBU I should get my original error of "ERROR: Sessions should be nested with care. Unset $TMUX to force" but instead it goes in to an unusable byobu session. This is how I know it has not reverted my changes to how they were before I started messing with things. Commented Jan 2, 2014 at 15:11
  • That last comment was in reply to @terdon sorry Commented Jan 2, 2014 at 15:20
  • @drewstiff - just include the user who you want to direct a comment to, like I did. Commented Jan 2, 2014 at 15:31

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.