Tmux – Clear to End of Line Uses Wrong Background Color

colorsterminaltmux

In ZSH prompt expansion, the command %E is supposed to "Clear to end of line."

This works:
enter image description here

However, it does not work in tmux:
enter image description here

The issue seems to be with BCE (Background Color Erase). In screen, I can add the option defbce on. I can't find any similar setting for tmux. Does it exist?

Best Answer

Unlike screen, tmux does not have switchable background colour erase capability in its terminal emulator. Erasure is always with the default background colour, never the current background colour.

Nicholas Marriott added it to the to-do list in September 2015, but stated at the time that neither he nor anyone else cares enough about it to implement it.

He later implemented it in October 2016, nearly a year after this answer was originally written.

Further reading

t_ut turns off BCE. tmux should support BCE but it depends on the tmux version, I think 2.1 is too old.

Related Question