On a DEC VT102, suppose you have a line where all 80 characters (in particular, the rightmost character) are in reverse video. You then move the cursor to the start of that line and use DCH (ESC [ P) to erase one character, thereby opening up a space at the right hand end of the line. Is that space reverse video or not? Does it matter what the current character attributes are?
My reading of the VT102 user guide (http://vt100.net/docs/vt102-ug/chapter5.html) suggests the space opened up at the right hand end of the line should be reverse video, as the guide says: "This creates a space character at right margin. This character has same character attribute as the last character moved left." and surely the last character moved left is the character which was formerly in the rightmost column, which was reverse video.
My experiments show that xterm and gnome-terminal don't do this. What does a real VT102 do in this case?
printf '\e[7mfoobar\e[G\e[P\e[m\n'
. The output isoobar
in reverse video, and there seems to be no space at the right-hand side at all.