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
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.
ReplyDeleteSoren-
ReplyDeleteTrue. 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
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.
ReplyDeleteThus 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?
As a matter of fact, there are a couple of options for nested screen sessions...
ReplyDelete1) 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
Is there any way to start byobu without reattaching an already running screen session?
ReplyDeleteI 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.
Hi Stoto-
ReplyDeleteCould 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.
Sure, there it is:
ReplyDeletehttps://bugs.launchpad.net/byobu/+bug/621388