How do I set a status line in my .screenrc that is compatible with byobu?

Asked by Christian Hudon on 2011-02-25

I use a distributed version control system (bazaar, actually) to make available common configurations files like .emacs, .screenrc, etc. on all the computers I use. I also like byobu, but it is not installed on all the computers I use (and installing it everywhere is not possible). I would like to be able to have a .screenrc that is not barebones and improves my "screen" experience on the computers that don't have byobu installed, but which doesn't prevent byobu from working properly on the computers where it is installed. However, I can't seem to find a way to do that.

The most problematic setting in my .screenrc is the status line. I really like adding the status line to barebones screen, but when I use byobu with that same .screenrc, the status line set there conflicts with the bottommost one that byobu sets.Is there a way having some settings be ignored (or different) when running byobu as compared to stock screen? Maybe having a separate .byoburc that is preferred by byobu if it is present. Or any other way of having some settings specific to stock screen, and some specific to byobu? Or having byobu override all status line settings set in .screenrc?

Thanks in advance for any help provided.

Question information

Language:
English Edit question
Status:
Solved
For:
byobu Edit question
Assignee:
No assignee Edit question
Solved by:
Dustin Kirkland 
Solved:
2011-03-02
Last query:
2011-03-02
Last reply:
2011-02-27
Dustin Kirkland  (kirkland) said : #1

Byobu sources ~/.screenrc last, so any settings you place there should
override any previous configuration set elsewhere by byobu. Is this
not the behavior you're experiencing?

Cheers,
Dustin

Christian Hudon (chrish) said : #2

For most settings, yes. But not for the status line, at least. I like to have a status line in .screenrc so a stock screen install shows something useful (the list of available windows). But when running byobu, I want all the byobu goodness in the two status lines. Right now what happens when running byobu with my .screenrc is that the first line of the status is the byobu one, and the second one is the one set in the .screenrc instead of the (more useful) byobu one.

Best Dustin Kirkland  (kirkland) said : #3

Okay, then you'll need two different .screenrc files.

Leave your ~/.screenrc empty (or at least empty of your status line).

Run byobu and you should get the "two line byobu goodness".

Create a second screenrc, but call it something different, like ~/.screenrc0.

When you want to launch screen with your other status line, launch with:
 $ screen -c ~/.screenrc0

You can set yourself an alias in your bashrc, if it helps:
 $ alias screensimple="screen -c ~/.screenrc0"

Perhaps that helps.

Christian Hudon (chrish) said : #4

Thanks, that works great. I kept all the settings that can be common to plain screen and byobu in .screenrc, and source that file from .screenrc0 (where the status line setting now lives).

Would you be open to modifying a bit the way in which byobu loads configuration files, though? My suggestion would be to have byobu look first for a .byoburc file, and if it exists, process that file and not .screenrc. This would allow people who want to maintain different configs for screen and byobu (like me) to do so without the need for an alias. And it wouldn't impact people who don't need this or don't know about it. Let me know if you are open to this, and I can open a wishlist bug report against byobu if you want.

Dustin Kirkland  (kirkland) said : #5

Christian,

I'm not opposed to your suggestion, but I'm at the mercy of what screen supports. I can't see any way in screen itself to conditionally source configuration files. If you can find a way to do that and explain it to me, I'm certainly open to adding such support to byobu...

Thanks,
Dustin

greenmoss (ktyubuntu) said : #6

Hi I found this page after searching for "byobu ignore screenrc". Thanks for the workaround; I will be using this short-term. If it doesn't already exist, long-term I would also like to vote for more flexibility in byobu's handling of .screenrc.

The use case is: when screen is installed but not byobu, screen would still use its default .screenrc; that is, using -c would be optional. When byobu is installed, it could have a configuration option to ignore .screenrc.

Thanks again, I love byobu.