- Maybe you didn't realize you were ALREADY in a
byobu session? That's when I saw this, a little "doh" moment.
Byobu, it seems, passes the arguments to the program it is using on the backend. Kudos if you realized that and passed -ls because you know that screen takes an -ls argument. But unless you specified otherwise, byobu is using TMUX, so TMUX complained about the arguments. This, I hope, more clearly explains the cryptic output.
I found that if I have multiple byobu sessions (not nested necessarily), and I call byobu from yet another terminal (not from within byobu), it will give me some choices. I'm assuming this is actually TMUX output:
byobu
Byobu sessions...
1. tmux: 0: 1 windows (created Wed Aug 27 10:31:14 2014) [209x57] (attached)
2. tmux: 1: 1 windows (created Wed Aug 27 10:31:23 2014) [80x23] (attached)
3. Create a new Byobu session (tmux)
4. Run a shell without Byobu (/bin/bash)
If there is only one session running, it doesn't give me this output.
I learned something from Dustin's answer, about the $TMUX environment variable. But that warrants a bit more explanation I think.
$TMUX will contain a path to some files that TMUX must use to juggle/keep-track-of the sessions.
(from within a byobu session)
echo $TMUX
/tmp/tmux-1000/default,2003,0
Obviously clearing this environment variable makes TMUX forget about all the sessions, and it let's you do what you want because it doesn't even realize you are nesting. This is referred to as forcing in the first error message you got.
I think a better alternative is to review all the open session and decide whether you really want to nest or not, and potentially close some stale session instead of forcing TMUX to bend to your will. But that is just IMHO.