Terminal: CNL and CPL should be constrained by margins

Created on 27 Sep 2019  ·  3Comments  ·  Source: microsoft/terminal

Environment

Windows build number: Version 10.0.18362.295
Also test with a recent commit 7faf3342e0187841d590fd018452c5c69fd52271

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 DECSTBM margins to 6 and 19
  • moves to line 12 (i.e. inside the margins)
  • executes the CNL sequence with a count of 99, to move down 99 lines
  • writes out CNL
  • moves back to line 12
  • executes the CPL sequence 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:

image

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.

image

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.

Area-VT Help Wanted Issue-Bug Product-Conhost Resolution-Fix-Committed

Most helpful comment

Yeah, matching XTerm and VTE sounds correct to me!

All 3 comments

Yeah, matching XTerm and VTE sounds correct to me!

:tada:This issue was addressed in #3628, which has now been successfully released as Windows Terminal Preview v0.8.10261.0.:tada:

Handy links:

:tada:This issue was addressed in #3628, which has now been successfully released as Windows Terminal Preview v0.9.433.0.:tada:

Handy links:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

waf picture waf  ·  3Comments

NickITGuy picture NickITGuy  ·  3Comments

TayYuanGeng picture TayYuanGeng  ·  3Comments

ghost picture ghost  ·  3Comments

alabuzhev picture alabuzhev  ·  3Comments