Double-exit counterintuitive when running byobu at login
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
byobu (Ubuntu) |
Fix Released
|
Low
|
Dustin Kirkland | ||
Lucid |
Fix Released
|
Low
|
Dustin Kirkland |
Bug Description
Binary package hint: byobu
When using byobu automatically at login, it nicely autolaunches and reattaches to your detached session, if any. In essence, it /becomes/ the remote environment, with the possibility to change colors to distinguish between remote hosts, etc.
The issue is, when you want to detach (F6) or exit (type exit in all tabs) from the remote session, you end up on the underlying remote shell. From there you need to exit again to actually exit from the remote session. I find it counterintuitive : if byobu is your remote environment, it needs to run from the point you login to the point you logout. It's even dangerous: once users are used to recognize the "remote" system by looking at byobu colors, being stuck in the limbo underlying remote shell without that branding, some people will definitely think they are back on the local shell (I did, once).
The behavior should be:
local shell -> ssh remote -> (byobu experience) -> exit or detach -> back to local shell
or
local shell -> ssh remote -> (shell exp.) -> byobu -> (byobu exp.) -> exit or detach -> (shell exp.) -> exit ->back to local shell
But not:
local shell -> ssh remote -> (byobu experience) -> exit or detach -> (shell experience) -> exit -> back to local shell
====
SRU
* IMPACT: the "double exit" is really annoying to some byobu users, and many people have complained about this over time
* HOW FIXED: this is trivially fixed on the auto launch line, with "&& exit 0"; note that if byobu/screen crashes or exits non-zero, then the && will not be satisfied, and it won't exit 0
* TEST CASE: install byobu; configure to launch by default (sudo dpkg-reconfigure byobu); ssh in; type "exit" or press F6 to detach; note that you have to "exit" from the launching shell therafter; install the new package; try "exit" or F6; should exit/detach, and quit the launching session; if a user just wants a shell without byobu, do "ssh -t remotehost bash"
* REGRESSION POTENTIAL: none really; perhaps some education on the slightly new behavior (which I can do on the Byobu blog), but it's *so* preferential, I think it's extremely well justified
===
Changed in byobu (Ubuntu): | |
importance: | Undecided → Wishlist |
Changed in byobu (Ubuntu): | |
status: | New → In Progress |
assignee: | nobody → Dustin Kirkland (kirkland) |
Changed in byobu (Ubuntu Lucid): | |
status: | New → In Progress |
importance: | Undecided → Low |
assignee: | nobody → Dustin Kirkland (kirkland) |
Changed in byobu (Ubuntu): | |
importance: | Wishlist → Low |
Changed in byobu (Ubuntu Lucid): | |
milestone: | none → lucid-updates |
Changed in byobu (Ubuntu Lucid): | |
status: | In Progress → Fix Committed |
tags: |
added: verification-done removed: verification-needed |
tags: | added: testcase |
Hi Thierry-
So we've toyed with this in Byobu in a few releases in the past. Basically, the line written to $HOME/.profile by byobu-launcher- install was changed to:
-`echo $- | grep -qs i` && byobu-launcher
+`echo $- | grep -qs i` && exec byobu-launcher
However, if byobu-launcher (or byobu, or screen) crashes entirely, you're basically locked out interactive shells on your system. It doesn't happen very often, but every once in a while it does. Screen has an occasional segfault. Or byobu does something silly. This situation can be fixed by either logging in as root and fixing the situation (which isn't always possible in Ubuntu systems), or launching a non-interactive shell (also non-trivial).
However, I just tested the following by linking /bin/false to /usr/bin/byobu:
-`echo $- | grep -qs i` && byobu-launcher
+`echo $- | grep -qs i` && byobu-launcher && exit
This actually works really well. If byobu exit (or detach) succeeds, you log all the way out on detach. But if byobu (or screen) crashes, then you still get your shell.
Thanks for bringing this up, Thierry, I'll get a fix committed!
:-Dustin