-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Description
Environment
Windows build number: Version 10.0.18362.295
Also test with a recent commit 7faf334
Steps to reproduce
In a conhost WSL shell, execute the following command:
echo -e "\e[6;19r\e[12H\e[99ECNL\e[12H\e[99FCPL\e[r"
This does the following:
- sets the top and bottom
DECSTBMmargins to 6 and 19 - moves to line 12 (i.e. inside the margins)
- executes the
CNLsequence with a count of 99, to move down 99 lines - writes out CNL
- moves back to line 12
- executes the
CPLsequence with a count of 99, to move up 99 lines - writes out CPL
Expected behavior
I can't find spec text to back this up, but in both XTerm and the Gnome VTE terminal these commands are constrained by the DECSTBM margins, so CNL doesn't move below row 19 (the bottom margin), and CPL doesn't move above row 6 (the top margin).
This is what the output looks like in XTerm:
Actual behavior
The margins are ignored by the Windows console, so CNL moves all the way to the bottom of the viewport, and CPL moves all the way to the top of the viewport.
I can't say for certain that this is wrong, but I think we should probably be trying to match the XTerm and VTE behaviour unless there is convincing evidence that they've got it wrong.