Strange behaviour of Delete Line and Insert Line when used above the top margin #141
Labels
Area-VT
Virtual Terminal sequence support
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Product-Conhost
For issues in the Console codebase
Resolution-Fix-Available
It's available in an Insiders build or a release
Work-Item
It's being tracked by an actual work item internally. (to be removed soon)
Milestone
Microsoft Windows [Version 10.0.16299.309]
I was curious to see how the Delete Line (
\033[M
) and Insert Line (\033[L
) escape sequences would behave when applied above the top margin of the scrolling region. So as a test, I labelled the first 8 lines of the screen with the numbers 1 to 8, set the top margin to line 4, then attempted to delete line 1.This was the command I used:
And this was the output I saw:
Instead of 1 row being deleted from line 1, I got 4 rows deleted from line 4.
I then tried the same thing with the Insert Line sequence:
And the output this time was:
Instead of 1 row being inserted at line 1, I got 2 rows deleted from line 4!
I don't think there is necessarily a "correct" behaviour in this situation, but I do think the current Windows behaviour is probably a bug.
One possible option would be to ignore these commands when used outside the defined margins (which I think is what XTerm does). Another option would be to handle the insert and delete as if the top margin had not been set, but still constrain the scrolling region within the bottom margin (which is how the Linux console behaves). Either choice would be preferable to the current behaviour.
The text was updated successfully, but these errors were encountered: