[bcl] add WriteLine(string) override to CStreamWriter needed due to corefx import...
commit73ae9dbc3693201939efce02b2b36c4ce5b352bd
authorBernhard Urban-Forster <lewurm@gmail.com>
Tue, 15 Oct 2019 20:29:41 +0000 (15 22:29 +0200)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Tue, 15 Oct 2019 20:29:41 +0000 (15 22:29 +0200)
tree34f89f4a153e06c1b045470eed69be58a12e347a
parentdc0eea6fd1c76c1060751d24ba8d0e93b8ea0277
[bcl] add WriteLine(string) override to CStreamWriter needed due to corefx import (#17336)

In https://github.com/mono/mono/commit/fd424c5dd07b2dbbd4aafbf9165a42166d789438 we switched over to the `TextWriter.cs`/`StreamWriter.cs` implementation of corefx. One subtle difference is that an override for `WriteLine(string)` in `StreamWriter` was introduced:
https://github.com/mono/corefx/blob/8e3b279377d1f01d2d089f24548e33855bf6502e/src/Common/src/CoreLib/System/IO/StreamWriter.cs#L526-L531
Previously the definition in `TextWriter` was used, which would call the base case `Write(char[],int,int)`.  The new override however won't call the base implementation at all, but directly uses the `Span`-variant.

This is a problem for our `CStreamWriter` implementation, since `WriteLine(string)` won't end up in the special handling for `Write(char[],int,int)`, which accounts for terminal cursor changes.

This is the real fix for https://github.com/mono/mono/issues/16701

This also reverts commit 68f5613422b7e74c2eeea6f5cbe9d76baf4cc8d1. ("[TermInfoDriver] update top/left value on Console.{CursorTop,CursorLeft} access (#16745)")
While it kind of masked the issue, it also posed a performance issue on some terminals (e.g. GNOME Terminal).
mcs/class/corlib/System/CStreamWriter.cs
mcs/class/corlib/System/TermInfoDriver.cs