-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Description
I'm unsure if this is an issue in dotnet run or in the underlying runtime/libraries, so please redirect elsewhere if needed. Also, I don't know if this is a deliberate change.
Customer impact
The impact of this change is that existing code that renders to the console produces corrupt output. It seems to be that, in the past, a Unix-style \n was enough to produce normal newline behaviors, whereas this has changed and now it only works on Windows if you output \r\n. Our cross-platform compatibility has been reduced.
Reproduction Steps
- Create a new console app (
dotnet new console) - Change the contents of
Program.csto beConsole.WriteLine("Line1\nLine2"); - Run it on Windows in either the Terminal app or the old-school console (i.e.,
cmd.exe) using the commanddotnet run
Expected behavior
In 7.0 preview 7 (I tried 7.0.100-preview.7.22377.5) and earlier, the output is:
Line1
Line2
This is the expected and desired output
Actual behavior
Starting from 7.0 RC1 and still happening with RC2 builds, you get:
Line1
Line2
Regression?
Yes, worked in 7.0.100-preview.7.22377.5
Known Workarounds
None
Configuration
Windows 11 x64
Works in 7.0.100-preview.7.22377.5
Fails in 7.0.100-rc.1.22431.12 and 7.0.100-rc.2.22463.6
Other information
No response