Tmux – How to Reset Background to Transparent

terminaltmuxurxvt

I recently set up tmux-powerline and noticed that the background color on the status-left, if changed, refuses to go back to default and transparent (if transparency is enabled). tmux-powerline broken

I was able to fix the status-right (because it's before the background is changed), but it seems impossible to clear/erase the background after it's set for a section. I'd love to be wrong about this, though, and was wondering if anyone knows of a solution?

set -g status-left='#[bg=colour89]ANYTHING CAN GO HERE[#bg=default] AND HERE TOO!'

I'd expect to have the background cleared out (bg=default at the beginning would have it stay transparent, and works for status-right), but I get a dark grey instead.

TERM = screen-256

Best Answer

The "transparent" feature relies upon the applications which run in the terminal to not explicitly set the background color. In particular, when clearing the background, these applications should not set the color. That corresponds to a terminal feature known as back color erase, or bce.

The TERM=screen-256color entry tells applications that they have to set the color when clearing the display (to ensure that the current color is used). There is a different terminal description screen-256color-bce which would do what you want in this case.

Further reading: