-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Description
- Your Windows build number:
Microsoft Windows [Version 10.0.16299.371]
- What you're doing and what's happening:
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.
printf "\ec\e[8;16r\e[12H\e[99BBOTTOM\r\e[99ATOP\n"
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).
- What's wrong / what should be happening instead:
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.
