Open JayJeckel opened 4 years ago
What you say may be correct, however the current implementation works, apart from Ansi.Cursor.Move.NextLine()
, which is indeed broken.
I've added a new sample to the RenderingPlayground
that demonstrates this. If you get this branch https://github.com/hackf5/command-line-api/tree/bug-970-ansi-escape-codes and run the RenderingPlayground
sample it will load the new Cursor
sample by default. This sample demonstrates that the cursor currently works as expected (I've fixed NextLine()
) on Windows at least.
I would be happy to tidy this up and add some unit tests in order to close this bug.
I've reread the spec and
7
8
are fine; see here.
However, to be explicit I think that scroll up and down are better represented as:
[S
[T
since this exactly matches the spec.
I've updated the sample.
I will update the test cases later and submit a PR.
While moving a bunch of in-house console apps to dotnet core using System.CommandLine, I've come across a few bugs in the System.CommandLine.Rendering.Ansi class.
[
after the escape, ie$"{Esc}{line}E";
should be$"{Esc}[{line}E";
.According to the ms docs Console Virtual Terminal Sequences and the wikipedia ANSI escape code article, the following also need correcting.
A
instead ofD
. Up one line isA
, whileD
is left one character.B
instead ofM
. Down one line isB
, whileM
is the reverse of\n
and moves up one line.s
instead of7
.u
instead of8
.