From the Canyon Edge -- :-Dustin

Sunday, June 13, 2010

Manual Override of Byobu-auto-launch

I launch Byobu by default on login on all of my Ubuntu machines. It's just such a rich, useful command line environment, compared to the basic shell.

Occasionally, I need to ssh into a remote machine and not launch Byobu. Sometimes I need to pivot from that machine to another on the same network. Sometimes I need to un-fubar an experimental Byobu configuration when I'm developing. And sometimes I'm ssh'ing from a crappy terminal like on my smart phone.

Here's an easy, one-liner to ssh into a remote host that would ordinarily launch Byobu, but not launch Byobu for this one session:
ssh -t remotehost bash
Note the -t option to SSH, which tells it to allocate a psuedo-tty. And note that you're telling SSH to immediately launch a bash shell.

Enjoy!

:-Dustin

7 comments:

  1. Passing -l to bash makes it consider it a login shell. Without it, it will skip /etc/profile and $HOME/.bash_profile which could give unexpected results.

    ReplyDelete
  2. Soren-

    True. However, if you use bash -l here, and process /etc/profile.d and ~/.profile, you will launch byobu. This post is about skipping profile processing ;-)

    Dustin

    ReplyDelete
  3. It's pretty funny - I actually do exactly opposite: I never launch byobu on any server I'm connected to - simply because I launch screen by default on laptop and use it to connect to servers.
    Thus launching byobu on connect will collide with already running screen session e. g. ctrl+a will never gets to remote machine because it will be caught by local screen.
    Is there any elegant solution for this which I might have overseen?

    ReplyDelete
  4. As a matter of fact, there are a couple of options for nested screen sessions...

    1) You can use ctrl-a-a (or ctrl-a-a-a, ad nauseum) to pass the escape sequence down to nested sessions

    2) Or you can just change the escape sequence to ctrl-b (or whatever)

    I often use nested screen sessions, but I rarely go more than 2-sessions deep, so I tend to use (2).

    :-Dustin

    ReplyDelete
  5. Is there any way to start byobu without reattaching an already running screen session?

    I tend to start multiple screen sessions on reboot (with crontab @reboot).

    But i also want to use byobu as a third screen session, but when I start byobu its just reattaches the first running screen session without loading any of the byobu stuff.

    ReplyDelete
  6. Hi Stoto-

    Could you please file a wishlist bug at bugs.launchpad.net/byobu? I think this is a reasonable request. It'll take some new code probably to handle this gracefully.

    ReplyDelete
  7. Sure, there it is:
    https://bugs.launchpad.net/byobu/+bug/621388

    ReplyDelete

Please do not use blog comments for support requests! Blog comments do not scale well to this effect.

Instead, please use Launchpad for Bugs and StackExchange for Questions.
* bugs.launchpad.net
* stackexchange.com

Thanks,
:-Dustin

Printfriendly