Skip to content

CNL and CPL should be constrained by margins #2926

@j4james

Description

@j4james

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 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-VTVirtual Terminal sequence supportHelp WantedWe encourage anyone to jump in on these.Issue-BugIt either shouldn't be doing this or needs an investigation.Product-ConhostFor issues in the Console codebaseResolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions