Issue 1:
Environment

Windows build number: [Version 10.0.18362.267] Windows 10 Professional Version 1903
Windows Terminal version (if applicable): whatever is out-of-the-box

Any other software?

Ubuntu 18.04.LTS from the Microsoft Store fully updated with

sudo apt update ; sudo apt upgrade

The joe editor installed in Ubuntu with

sudo apt install joe

Steps to reproduce

Start the joe editor with a new file without specifying a filename

Type 3 lines at least to see what happens, e.g.:

line1
line2
line3

Go back with the cursor to the beginning of line2.

Press the ENTER key.

Expected behavior

A new line should be inserted in the place of the cursor and the part of the file starting with the cursor position was in should be scrolled down on the screen and the last shown line should scroll out (disappear) and the cursor should move one line down.

I.e. you should see

line1

line2
line3

and the new cursor position should be at the beginning of line2

Note that after saving the file, the expected behavior is what correctly happens in the file data, only the display behavior is incorrect.

Note, that this worked correctly in Windows 1803 with the same Ubuntu 18.04 LTS and joe versions. The upgrade to Windows 1903 broke this, and reinstalling joe and reinstalling the entire Ubuntu 18.04 LTS distribution did not fix this either.

Actual behavior

No scrolling of the part after the cursor happens, instead the line the cursor was in is cleared (becomes empty, not disappear), and the cursor (correctly) moves down to the beginning of the next line.

I.e. you see

line1

line3

and the cursor position is at the beginning of line3.

Note that after saving the file, the expected behavior is what correctly happens to the file data, only the display behavior is incorrect.

Issue 2:
Environment

Windows build number: 10.0.18362.0
Windows Terminal version (if applicable): 0.5.2762.0

Steps to reproduce

Issue an EL (clear to end of line, \e[K) when the cursor is at the rightmost position, in "pending wrap" a.k.a. "delayed eol wrap" state. Print further characters. E.g.:

printf "%$(tput cols)s\e[K%s\n" 0123456789 abcdef

Expected behavior

xterm's behavior, and as far as I know the "official" one is that EL clears the "delayed eol wrap" state along with erasing the last column (9), resulting in (denoting the right margin by a "left one eighth block" ▏):

012345678a▏
bcdef ▏

Some terminals, including VTE, iTerm2, Kitty, Konsole, PuTTY 0.73 intentionally deviate: make EL not clear the "delayed eol wrap" flag and not erase the last character either:

0123456789▏
abcdef ▏

Rationale:

There are several utilities that want to just simply print some text with colors or other attributes, without caring about the terminal width or doing anything more complex terminal driving. If these attributes include a background color too, the behavior is messy across a linewrap, due to the terribly designed bce (background color earse) feature. (Now, VTE, and perhaps some other emulators too, intentionally implement bce differently, as another means of mitigating the problem I'm describing here, but let's leave that to another day.)

As a workaround for the background color problem, several utilities decide to also emit an EL after restoring the background color, to earse the faulty color there. And they often don't realize that this introduces an even more serious issue: at linewrap, a character might get dropped from the output. An example is grep with its default settings. PuTTY 0.73's changelog refers to gcc.

Notes We (VTE) haven't received any bugreport about it, nor did I saw one in Kitty's, Konsole's or iTerm2's bugtracker. Also there's no vttest test case for this.

I do recommend that you follow our behavior here. :)

Actual behavior

The last digit 9 is wiped out by EL for no apparent reason since the "delayed eol wrap" state isn't cleared, the first letter a is printed in the next line anyway:

012345678 ▏
abcdef ▏

Or, at 38 columns:

echo 'The quick brown fox jumps over the lazy dog.' | GREP_COLORS='ms=1;91' grep z

The quick brown fox jumps over the la ▏
y dog. ▏