Do not use colors when affected by bug 315871 (color change limit of 16)

Bug #867746 reported by Daniel Hahler on 2011-10-04
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu (Ubuntu)
screen (Ubuntu)

Bug Description

When using screen on a system which has a not-so-recent version of screen, you will run into bug #315871, which is about limiting the number of color changes to 16.

It would be great if byobu would detect that the version of screen is too old and then just would skip coloring its output completely.

Otherwise you're likely to run into the situation, where an additional appearance of the network information causes the rest of the line to toggle between white background and the (more) correct one.
This becomes quite distracting, since more than just one field changes its background colors, but most of the line.

Dustin Kirkland  (kirkland) wrote :

Moved this bug over to Byobu. Will try to get this fixed there.

Changed in byobu (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Changed in screen (Ubuntu):
status: New → Invalid
Daniel Hahler (blueyed) wrote :

Thanks for accepting it.

I think this can be solved by
1. detecting if the version of screen running is affected (via its version information?)
2. removing any color codes from the output

Dustin Kirkland  (kirkland) wrote :

I'll try to fix this in Byobu.

Changed in byobu:
status: New → Confirmed
importance: Undecided → Low
Changed in byobu (Ubuntu):
status: Confirmed → Invalid
Dustin Kirkland  (kirkland) wrote :

Hi Daniel,

I don't really see any way to actually determine this from screen -v, which for me is:
 * Screen version 4.00.03jw4 (FAU) 2-May-06

Debian and Ubuntu have the patch necessary to solve the problem, not sure about other distros, who may or may not be carrying the one line patch.

It's easy for me to remove the color codes from the output, but I can't see any way to tell if screen has been patch accordingly. Can you?

Changed in byobu:
status: Confirmed → Incomplete

Hash: SHA1

What comes to mind:
 - version must be the release containing the fix (not released yet)
 - otherwise whitelist Debian and Ubuntu only, also checking the
package version.
 - detect it based on another patch, which is visible somehow (e.g. by
using "strings" on the binary)

Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


Dustin Kirkland  (kirkland) wrote :

Hi Daniel,

Okay, I dug through strings /usr/bin/screen, and couldn't find anything of interest there.

I suppose I'll just build and ship a whitelist of distros and versions that carry the patch. As other distro package maintainers tell me their distro is carrying the patch (or shipping a newer screen), we'll add them to that whitelist. That's about the best we can do. Thanks!

Changed in byobu:
status: Incomplete → Triaged
Changed in byobu:
status: Triaged → In Progress
status: In Progress → Fix Committed
Changed in byobu (Ubuntu):
status: Invalid → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package byobu - 4.50-0ubuntu1

byobu (4.50-0ubuntu1) precise; urgency=low

  * usr/bin/byobu-mondrian:
    - clean up code, fix idempotence
  * usr/bin/byobu-mondrian => usr/lib/byobu/include/modrian,
    usr/lib/byobu/include/, usr/share/byobu/keybindings/f-
    keys.tmux, usr/share/byobu/keybindings/f-keys.tmux.disable,
    - install modrian
  * usr/share/byobu/profiles/tmux:
    - fix action bar color
  * usr/lib/byobu/include/mondrian:
  * usr/lib/byobu/ec2_cost, usr/lib/byobu/hostname,
    usr/lib/byobu/include/shutil, usr/lib/byobu/ip_address: LP: #894038
    - background all wgets, as these can be expensive (cough OpenStack cough)
    - sleep for 0.02 seconds after each wget, as most EC2 wgets take less
      than 0.01 seconds, but some might take longer
    - after backgrounded wget and sleep, attempt to read the results of the
      wget from a cache file; if this succeeds, proceed and use it
    - if not, fail through gracefully, and pick up the results from the
      cach file on the next run
  * usr/share/byobu/keybindings/f-keys.tmux,
    usr/share/man/man1/byobu.1: LP: #888248
    - add Alt-Insert in tmux for "paste"
    - document scrollback/copy/paste procedures
  * usr/bin/byobu-janitor: LP: #867746
    - create a whitelist of distros carrying the LP: #315871 fix
    - default to monochrome for other distros on initial profile creation
 -- Dustin Kirkland <email address hidden> Fri, 18 Nov 2011 15:41:36 -0600

Changed in byobu (Ubuntu):
status: Fix Committed → Fix Released
Daniel Hahler (blueyed) wrote :

Thanks for looking into it.

Some remarks:
1. not all versions of Debian and Ubuntu (nor Arch) are fixed in general.
2. it gets only set initially. This will not fix it when upgrading and/or when deploying the same config across multiple hosts. I will therefore remove the "color" file from there then.

Since it's easy to fix this locally (by editing ~/.byobu/color), I am fine with it.


Link to this commit: (already changed)
Link to file:

Changed in byobu:
status: Fix Committed → Fix Released
status: Fix Released → Triaged
Dustin Kirkland  (kirkland) wrote :

Okay, I'm reverting the previous commit. It seems that trying to detect if we have a patched screen is hard and unreliable. If you have a broken screen color situation, a) edit ~/.byobu/color, b) ask your local screen maintainer to cherry pick the 1-line fix from upstream git.

Changed in byobu:
status: Triaged → In Progress
status: In Progress → Fix Committed
Changed in byobu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers