In ZSH prompt expansion, the command %E is supposed to "Clear to end of line."
This works. We see it in the grey bar going all the way across.
Any idea what the cause of this is, and how it can be fixed?
When you send one of the ECMA-48 erase control sequences, whether the erasure uses the current background colour or the default background colour varies amongst different terminal types. (In the terminfo database, there is a capability that allows programs to determine what the terminal that they are talking to will do. It is named
bce. The termcap equivalent name is
ut.) You are setting the current background colour, and then erasing to the end of the line, expecting the erasure to always use that current colour.
screen is a terminal emulator itself. But unlike hardware terminals its behaviour in this regard is switchable. By default, background colour erase is switched off, and the control sequence causes erasure with the default colour. One switches it on with the
bce command. One sets the default for the
bce setting in all new screens with the
So switch it on. It's as simple as that.