14

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?

2
  • Also iTerm2 and Terminal.app on macOS don't do it, which you can test with printf '\e[7mfoobar\e[G\e[P\e[m\n'. The output is oobar in reverse video, and there seems to be no space at the right-hand side at all.
    – weibeld
    Jan 22, 2019 at 11:28
  • Reverse video varies wildly amongst terminal emulators, some not even implementing it as any sort of reversal in certain situations. Terminal emulators are significantly divergent from real video terminals when it comes to this.
    – JdeBP
    Apr 14, 2020 at 4:08

1 Answer 1

9

I can only provide my memories of a dozen or so years of programming for these DEC terminals.

The 'new' character at the right hand end of the screen is inverse video.

If I recall correctly, on the VT320 onwards there was a configuration setting to change this, such that it would appear not inverted.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .