Better handling of default TERM environment variable

Bug #1544983 reported by humble_coffee on 2016-02-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu
Low
Dustin Kirkland 

Bug Description

Since starting to use byobu, I've encountered two frustrating issues that have caused all kinds of headaches trying to sort out, both relating to the default value of TERM being set to "screen" inside of byobu. One is that all kinds of key bindings were not working inside of emacs. I ended up getting around this by putting in bindings for the escape codes for those key combinations, which is not so bad now that I know about it, but I still have to put in a new binding every now and then when setting one up.

The second is that without 256 color support, I was experiencing issues where some colors were being lost as black on black. I assumed this was a bug in the emacs package I was using, as did this person (https://github.com/company-mode/company-mode/issues/380)

I gather from the below config snippet from /usr/share/byobu/profiles/tmux that setting TERM to "screen-256color" breaks things for vim users, so it sounds like there is no sensible default that won't break things for someone. Given the pain that I experienced (and I suspect many others also based on various posts recommending to byobu users to change the value of TERM), perhaps it would be useful to have some kind of guided assistance for first time runs of byobu, similar to when a user presses control-a for the first time. This could remove troubles down the line for users, especially to those new to the arcane land of TTY config, as I was... and still am. Also I know that the key bindings issues may not actually be solvable, but at least by bringing the TERM value to new users' attention, they may be slightly more forewarned.

# Cannot use:
# - screen-bce, screen-256color-bce: tmux does not support bce
# - screen-256color: vim broken without -bce
set -g default-terminal "screen"

Dustin Kirkland  (kirkland) wrote :

Thanks for the report.

Are you able to fix this by overriding in your ~/.byobu/.tmux.conf file?

If so, please paste the snippet you need, and I'll be happy to add it to the byobu manpage in the known issues section.

Changed in byobu:
importance: Undecided → Low
status: New → Incomplete
assignee: nobody → Dustin Kirkland  (kirkland)
humble_coffee (humblecoffee) wrote :

Yep, the solution I came up with was putting the following in my ~/.byobu/.tmux.conf:

    set -g default-terminal "screen-256color"

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers