byobu-tmux changes background color in applications

Bug #908766 reported by Philip Muškovac
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
byobu
Won't Fix
Low
Unassigned
byobu (Ubuntu)
Expired
Low
Unassigned

Bug Description

Since the update to byobu 5.0-0ubuntu1, vim's syntax highlighting is unable to set the background color anymore.

As example:
open a package's debian/changelog file in vim, change the release to something invalid, like UNRELEASED. Then vim will mark the word invalid by setting its background color to red, but with new byobu it keeps the default background color.

This works with byobu < 5.0 and without byobu.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: byobu 5.0-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-6.12-generic 3.2.0-rc6
Uname: Linux 3.2.0-6-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.90-0ubuntu1
Architecture: amd64
Date: Mon Dec 26 14:35:54 2011
InstallationMedia: Kubuntu 11.10 "Oneiric Ocelot" - Beta amd64 (20111007)
PackageArchitecture: all
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=en_US.UTF-8
 LANGUAGE=en_US.UTF-8
ScreenRC:

SourcePackage: byobu
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Philip Muškovac (yofel) wrote :
tags: added: regression-release
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Can you attach a screenshot?

Changed in byobu (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Okay, so it seems that vim needs TERM=screen-bce and not TERM=screen-256color for the background color to work.

I'll switch byobu to export TERM=screen-bce for now, but I don't yet know what implications there might be. If regressions happen, I'll have to roll this back.

Note that you can set this manually in your ~/.vimrc with:
set term=screen-bce
or
set term=xterm-color

Changed in byobu (Ubuntu):
status: Incomplete → In Progress
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

  [ Dustin Kirkland ]
  * icons/byobu_multi.svg, === removed directory icons,
    - save some space in the tarball
  * usr/lib/byobu/logo:
    - add a linux mint logo
  * usr/lib/byobu/include/layout => usr/bin/byobu-layout,
    usr/share/byobu/keybindings/f-keys.tmux, usr/share/man/man1/byobu-
    layout.1:
    - move the layout library utility to a generally usable byobu-layout
      in the system path
    - add specific named layout support to both save and restore operations
    - add a manpage
  * usr/bin/Makefile.am, usr/lib/byobu/include/Makefile.am,
    usr/share/man/man1/Makefile.am:
    - install the byobu-layout tool and manpage
  * usr/lib/byobu/ec2_cost, usr/lib/byobu/network:
    - use /proc/net/dev for network transfer calculations
    - fixes issue with ifconfig format changes
  * usr/share/byobu/keybindings/f-keys.tmux,
    usr/share/byobu/keybindings/f-keys.tmux.disable,
    usr/share/doc/byobu/help.tmux.txt: LP: #912637
    - change prev/next window keybinding from alt-left/right to
      ctrl-shift-left/right; seems alt-left-right are used by irssi
  * README: LP: #911825
    - add note about tmux version required
  * usr/lib/byobu/include/common: LP: #911149
    - when backend is not automatically set, check if screen or tmux
      is installed on the system before setting the default backend
  * debian/control: LP: #910187
    - depend on tmux | screen, recommend tmux and screen
    - hopefully this solves dependency resolution on hardy
  * usr/bin/byobu, usr/share/byobu/profiles/tmux: LP: #908766
    - use screen-bce instead of screen-256color, to support background
      colors correctly
  * usr/bin/byobu-config: LP: #910638
    - ensure that config dir exists before touching reload flag

  [ Daniel Hahler ]
  * usr/bin/byobu-ctrl-a, usr/share/byobu/profiles/tmux: LP: #910779
    - don't use BYOBU_PREFIX for tmux paths
 -- Dustin Kirkland <email address hidden> Thu, 29 Dec 2011 12:28:51 -0600

Changed in byobu (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Daniel Hahler (blueyed) wrote :

Please consider using screen-256color-bce instead.

This would include both "256 colors" and "bce".

Changed in byobu (Ubuntu):
status: Fix Released → Triaged
Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 908766] Re: byobu changes background color in applications

2012/1/9 Daniel Hahler <email address hidden>:
> Please consider using screen-256color-bce instead.
>
> This would include both "256 colors" and "bce".

Hmm, that doesn't solve the problem though...

Try:
 $ TERM=screen-256color-bce vim debian/changelog
(or any other file that vim sets the background color)

Changed in byobu (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Iain Lane (laney) wrote : Re: byobu changes background color in applications

-bce seems to break background colours in mutt :(. Both screen-256color and screen work. The attached screenshot is with TERM=screen-bce using byobu 5.2-1 on Debian unstable (tmux 1.5-3).

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Note that the tmux FAQ explicitly recommends against setting TERM to anything other than screen or screen-256color:
 * http://tmux.cvs.sourceforge.net/viewvc/tmux/tmux/FAQ

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Okay, looks like the least common denominator is working best, in my testing, setting TERM=screen works in all of my test scenarios.

TERM=screen
 * Working: vim/tmux, vim/screen, mutt/tmux, mutt/screen, 256color2.pl
 * Broken: none

TERM=screen-256color
 * Working: vim/screen, mutt/screen, mutt/tmux, 256color2.pl
 * Broken: vim/tmux

TERM=screen-256color-bce
 * Working: vim/screen, mutt/screen, 256color2.pl
 * Broken: vim/tmux, mutt/tmux

TERM=screen-bce
 * Working: vim/tmux, vim/screen, mutt/screen, 256color2.pl
 * Broken: mutt/tmux

vim/tmux:

Changed in byobu (Ubuntu):
status: Incomplete → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

  [ Daniel Hahler ]
  * usr/bin/Makefile.am:
    - fix safe link creation

  [ Dustin Kirkland ]
  * usr/share/byobu/profiles/tmux:
    - add some whitespace
  * usr/bin/byobu, usr/share/byobu/profiles/tmux: LP: #908766, #900309
    - TERM must be 'screen', to work with: a) 256 colors, and
      b) vim/mutt with bce; tmux does not support bce properly
  * usr/bin/byobu: LP: #914424
    - use READLINK
  * usr/share/byobu/profiles/tmux:
    - add some comments
  * usr/lib/byobu/ec2_cost, usr/lib/byobu/network: LP: #914098
    - fix regression from r1839, add colon to IFS
  * usr/share/man/man1/byobu.1: LP: #913817
    - mention byobu-select-backend prominently in the manpage
  * usr/bin/byobu-status, usr/share/man/man1/byobu.1: LP: #898065
    - support ip_address4 and ip_address6 in the status line
    - allows for users to see both ipv4 and ipv6 addresses simultaneously
      rather than one or the other
  * etc/profile.d/Z97-byobu.sh:
    - support LC_TERMTYPE=[byobu|byobu-screen|byobu-tmux]
  * etc/profile.d/Z97-byobu.sh, usr/bin/byobu-launcher: LP: #897711
    - allow nesting, if LC_BYOBU > 1
  * usr/bin/byobu, usr/bin/byobu-janitor, usr/lib/byobu/include/common,
    usr/lib/byobu/include/constants:
    - for users upgrading from an older version of byobu, where they were
      previously using a screen backend, keep them using a screen backend
    - for new users, default to tmux backend
  * usr/bin/byobu, usr/share/byobu/profiles/common: LP: #882067
    - maximize the number of windows we can fit in byobu-screen by dropping
      the $SHELL window title
    - users can override by setting 'shelltitle' in ~/.screenrc
    - fixes a problem where screen hangs when interactively setting shelltitle
    - always easy to name a window with F8

  [ Dustin Kirkland and Ryan Thompson ]
  * usr/bin/byobu-reconnect-sockets, usr/bin/byobu-select-session: LP: #908944
    - improve support for importing X11 environment variables
 -- Dustin Kirkland <email address hidden> Sun, 08 Jan 2012 20:28:08 -0600

Changed in byobu (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Daniel Hahler (blueyed) wrote :

`tput colors` returns "8" with TERM=screen for me and vim appears to use only 8 colors, too.

Changed in byobu (Ubuntu):
status: Fix Released → Triaged
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Daniel,

Please, if you're going to reopen this bug, give:
 1) an attached screenshot of some application running in only 8 colors
 2) an attached screenshot of the same application running full 256 colors (with whatever TERM settings worked)
 3) specific instructions on how I might run the same application

Thanks,
Dustin

Changed in byobu (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Daniel Hahler (blueyed) wrote :

1) I do not think a screenshot of Vim in 8 color mode is that much useful?! (":!tput colors" reports 8)
2) It works with screen-256color-bce (instead of screen-bce)

I am using screen 4.0.3-14ubuntu7~blueyedppa2~lucid on a Debian Squeeze system.

It boils down to this, in standard screen:

% echo $TERM
screen-256color-bce
% tput colors
256
% TERM=screen-bce
% tput colors
8

I am attaching my .screenrc and .screenrc.common, which gets included from there.

Revision history for this message
Daniel Hahler (blueyed) wrote :
Revision history for this message
Daniel Hahler (blueyed) wrote :
Revision history for this message
Daniel Hahler (blueyed) wrote :

Moving away my ~/.screenrc does not help, and it also happens on my Ubuntu machine (Precise).

Revision history for this message
Daniel Hahler (blueyed) wrote :

The 256colors2.pl script works btw, but in contrast to Vim it does not appear to check for terminal properties/capabilities.

I think Vim notices that there is only support for 8 colors according to $TERM and behaves like that.
A workaround appears to "set t_Co=256" in Vim.

Changed in byobu (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 908766] Re: byobu changes background color in applications

Would you please attach the screenshots? Humor me so that I can see
what you're talking about. Both the good, and the bad. Please.

Changed in byobu (Ubuntu):
status: Triaged → Incomplete
summary: - byobu changes background color in applications
+ byobu-tmux changes background color in applications
Revision history for this message
Philip Muškovac (yofel) wrote :

Just a quick note that from my POV this is fixed. At least vim works fine again these days.

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 908766] Re: byobu-tmux changes background color in applications

Great, thanks, Philip. Can you confirm this with your byobu -v information?

Revision history for this message
Philip Muškovac (yofel) wrote :

byobu version 5.15
tmux 1.6

Revision history for this message
Andreas Ntaflos (daff) wrote :

To chime in here, there still appears to be the problem that Vim doesn't understand that the terminal is capable of displaying 256 colors *unless* one explicitly sets 'set t_Co=256' in ~/.vimrc. I don't know if Byobu can do anything about that but it seems Vim only understands 256 colors if the TERM variable contains a string like "256color". At least according to http://vim.wikia.com/wiki/256_colors_in_vim if I understood it correctly.

I can provide screenshots if that helps.

Using byobu version 5.15, tmux 1.5.

Revision history for this message
Daniel Hahler (blueyed) wrote :

@Dustin: I do not think it helps much to attach a screenshot, which shows the result of ":set t_Co?" as "t_Co=8".

@Philip: are you saying that when starting vim in byobu/tmux using "vim -u NONE", ":set t_Co?" says 256 for you?

My version information:
  byobu version 5.16
  tmux 1.6

Revision history for this message
Philip Muškovac (yofel) wrote :

No, for me t_Co is set to 8, which is the case too in byobu 4.37 so not what I filed a bug about.
As I said in the description, my primary issue was missing background colors in syntax highlighting. That works again now, even with t_Co=8 by simply using vim -u NONE and :syntax on.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for byobu (Ubuntu) because there has been no activity for 60 days.]

Changed in byobu (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Daniel Hahler (blueyed) wrote :

I cannot reproduce the problems mentioned with Vim and screen-256color (in Ubuntu Precise):

> TERM=screen-256color
> * Working: vim/screen, mutt/screen, mutt/tmux, 256color2.pl
> * Broken: vim/tmux

I am attaching a screenshot.

Please consider using screen-256color again, so that Vim returns 256 for t_Co by default (without forcing it).

My current workaround is to explicitly set screen-256color (tmux.conf and TERM) and I have not recognized any problems.

When changing this, please take bug 900309 in mind (test if screen-256color is available via terminfo/termcap for tmux/screen).

Changed in byobu (Ubuntu):
status: Expired → Triaged
Revision history for this message
Daniel Hahler (blueyed) wrote :
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

From what I can tell, Bug #900309 and Bug #908766 are in opposition, and I have no solution yet that solves these two requests and causes no regressions.

For that reason, I'm downgrading this bug from Triaged to Incomplete.

I'm open to merge proposals or patches. But in my heavy, daily usage of byobu, I'm not seeing any of the problems in either of these bugs. That doesn't mean they don't exist, they're just off my beaten path.

Changed in byobu:
status: New → Triaged
importance: Undecided → Low
status: Triaged → Incomplete
Changed in byobu (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for byobu (Ubuntu) because there has been no activity for 60 days.]

Changed in byobu (Ubuntu):
status: Incomplete → Expired
Changed in byobu:
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.