IssueRaiser

[Discussion] System.Console re-design

The initial design of `System.Console` was mainly driven by Windows OS capabilities and available APIs. When .NET became cross platform, a number of issues arose (click on the details button below to see the full list) as there was no good way of mapping some Windows-specific concepts to Unix. A good example are all `Console.Window*` APIs: on Unix the Window is owned by the Terminal app, the .NET Console App has no control over it. The current design makes no distinction between `Console` and `Terminal`, which is also a source of plenty of issues (mostly for apps that have redirected output). Moreover, `System.Console` is a `static class` and there is no common abstraction that would allow not only for testing but also for integrating projects like [spectre.console](https://github.com/spectreconsole/spectre.console) and [System.CommandLine.Rendering](https://github.com/dotnet/command-line-api/tree/main/src/System.CommandLine.Rendering). By creating this issue I would like to start a public and transparent discussion about what is wrong with the current design of `System.Console` and how we could fix that. Based on the results of this discussion, I would like to create a proposal for .NET 7. cc @jonsequitur @KathleenDollard @patriksvensson @colombod @Keboo @howardvanrooijen @daxian-dbw <details> * `Console.ReadKey`: * `Console.ReadKey` returns incomplete information for some key sequences on Linux #802 (.NET 6) * `System.ConsoleKeyInfo` can not handle Unicode su

Posted by adamsitnik on May 6, 2021, 9:55 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

github (SaaS)

[Discussion] System.Console re-design

adamsitnikMay 6, 2021, 9:55 AM

The initial design of `System.Console` was mainly driven by Windows OS capabilities and available APIs. When .NET became cross platform, a number of issues arose (click on the details button below to see the full list) as there was no good way of mapping some Windows-specific concepts to Unix. A good example are all `Console.Window*` APIs: on Unix the Window is owned by the Terminal app, the .NET Console App has no control over it. The current design makes no distinction between `Console` and `Terminal`, which is also a source of plenty of issues (mostly for apps that have redirected output). Moreover, `System.Console` is a `static class` and there is no common abstraction that would allow not only for testing but also for integrating projects like [spectre.console](https://github.com/spectreconsole/spectre.console) and [System.CommandLine.Rendering](https://github.com/dotnet/command-line-api/tree/main/src/System.CommandLine.Rendering). By creating this issue I would like to start a public and transparent discussion about what is wrong with the current design of `System.Console` and how we could fix that. Based on the results of this discussion, I would like to create a proposal for .NET 7. cc @jonsequitur @KathleenDollard @patriksvensson @colombod @Keboo @howardvanrooijen @daxian-dbw <details> * `Console.ReadKey`: * `Console.ReadKey` returns incomplete information for some key sequences on Linux #802 (.NET 6) * `System.ConsoleKeyInfo` can not handle Unicode su

Comments (0)

No comments yet. Start the discussion.

Comment on this issue