vezel-dev / cathode

A terminal-centric replacement for the .NET console APIs.
https://docs.vezel.dev/cathode
BSD Zero Clause License
91 stars 7 forks source link

MoveCursorTo parameters are named backwards #87

Closed scottbilas closed 2 years ago

scottbilas commented 2 years ago

ControlBuilder.MoveCursorTo receives a line and column:

https://github.com/vezel-dev/cathode/blob/2fe549085863088814ffc0fa2a1fce003ec97b5d/src/core/Text/Control/ControlBuilder.cs#L489

And prints it as ESC[<column>;<line>H

https://github.com/vezel-dev/cathode/blob/2fe549085863088814ffc0fa2a1fce003ec97b5d/src/core/Text/Control/ControlBuilder.cs#L500

Yet MS's spec says it should be ESC[<y>;<x>H, which would map in this function to ESC[<line>;<column>H.

I personally prefer passing in x, y, and was already (accidentally) doing this, before I happened to notice that the parameter names didn't match.

alexrp commented 2 years ago

Huh, that's strange. I intended the method parameter order to match the escape sequence parameter order. I guess this slipped through because the samples in the repo only test MoveCursorTo(0, 0)...

alexrp commented 2 years ago

3ef47da0bfbaad9c414bf0bd2f5dd48e8dbb1a73