CUU and CUD commands should be constrained by the scrolling margins #170
Labels
Product-Conhost
For issues in the Console codebase
Resolution-Fix-Available
It's available in an Insiders build or a release
Milestone
Microsoft Windows [Version 10.0.16299.371]
I'm setting the top and bottom scrolling margins with the DECSTBM escape sequence, then using the CUU and CUD sequences to move about within that range. According to the VT100 documentation for CUU: "If an attempt is made to move the cursor above the top margin, the cursor stops at the top margin." Similarly for the CUD command: "If an attempt is made to move the cursor below the bottom margin, the cursor stops at the bottom margin.
But that's not the behaviour I'm seeing in the Windows console. In the test case below, I've set the top margin to 8, the bottom margin to 16. Then starting from the centre of that range, I move down 99 lines and output some text to mark the bottom of the range, then up 99 lines to mark the top of the range.
If everything is working correctly, I'd expect the TOP and BOTTOM markers to be on line 8 and 16 respectively, but in the Windows console they appear at the very top and bottom of the screen. The screenshots below compares the output on XTerm, Konsole, Gnome Terminal, and the Windows console (left to right).
The vertical cursor movement commands CUU and CUD should not be able to move outside the scrolling margins - they should be constrained within those boundaries, the same way the various Linux terminal emulators behave.
The text was updated successfully, but these errors were encountered: