Use only valid TERM environment with screen ("screen-256color" might fall back to "vt100")

Bug #900309 reported by Daniel Hahler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu
Won't Fix
Low
Unassigned
byobu (Ubuntu)
Expired
Low
Unassigned

Bug Description

bin/byobu uses "screen-256color" if the terminal supports 256 colors (like xterm-256color does).

However, if there's no terminfo installed for screen-256color, screen will fallback to vt100, which means no colors and a lot less goodies.

Therefore, before byobu does SCREEN_TERM="-T screen-256color" it should check if that's a valid value, e.g by testing with "TERM=$to_test tput longname 2>/dev/null".

Daniel Hahler (blueyed)
summary: - Use only valid TERM environment with screen
+ Use only valid TERM environment with screen ("screen-256color" might
+ fall back to "vt100")
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hmm, I don't quite understand what situation we're trying to protect against here, that we're not already handling.

What's the actual problem, and how do I reproduce it?

We currently do this:
                # Check if our terminfo supports 256 colors
                if command -v tput >/dev/null; then
                        if [ "$(tput colors 2>/dev/null || echo 0)" = "256" ]; then
                                SCREEN_TERM="-T screen-256color"
                        fi
                fi

What situations are not handled/detected by that?

Changed in byobu:
importance: Undecided → Wishlist
status: New → Incomplete
Revision history for this message
Daniel Hahler (blueyed) wrote :

There's a problem when the current terminal supports 256 colors, but there's no terminfo file for screen-256color.

To reproduce the case of a missing terminfo (e.g. old system etc), just set SCREEN_TERM="-T screen-256color-notfound" in the snippet above.
Screen will then fallback to using vt100 (at least the screen I was using when encountering this).

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

Hopefully this should be fixed by the commit for Bug #908766, which changes TERM=screen. From everything I can tell, this doesn't break 256 colors (I can see 256 colors in various applications like vim, mutt, and 256colors2.pl).

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

Unfortunately it is not fixed for me (showing only 8 colors now in Vim). I've commented on bug #908766.

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

Re-opening this bug: the issue still would hold if "screen" was not available via terminfo/termcap.

While that is far more unlikely, it still holds, especially given that we might use "screen-256color(-bce)" again.

Changed in byobu:
status: Fix Released → Triaged
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 (Ubuntu):
importance: Undecided → Low
Changed in byobu:
importance: Wishlist → Low
Changed in byobu (Ubuntu):
status: New → Triaged
Changed in byobu:
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.