Skip to content

Improve and simplify the IConsoleService interface#5924

Open
mikem8361 wants to merge 2 commits into
dotnet:mainfrom
mikem8361:betterconsoleservice
Open

Improve and simplify the IConsoleService interface#5924
mikem8361 wants to merge 2 commits into
dotnet:mainfrom
mikem8361:betterconsoleservice

Conversation

@mikem8361

Copy link
Copy Markdown
Contributor

Combined all the explicit Write functions into one function with the output type.

First step in improving the overall (managed and native) console infrastructure.

@mikem8361
mikem8361 requested a review from a team as a code owner July 13, 2026 18:25
{
public enum OutputType
{
Normal = 0,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These feel a little orthogonal - one is about the verbosity, while the other is about the output style.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It matches the old functions Write, WriteWarning, WriteErrorLine, etc. I guess it is including both into one type to be able to funnel all the output through one function.

int WindowWidth { get; }
/// <param name="type">type of text to write</param>
/// <param name="text">text to write</param>
void WriteString(OutputType type, string text);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the console service now has an output type of DML - why do callers need SupportsDml? That being said - given the output content changes based on dml or not - the supportsdml feels necessary.

Combined all the explicit Write functions into one function with the output type.

First step in improving the overall (managed and native) console infrastructure.
@mikem8361
mikem8361 force-pushed the betterconsoleservice branch from d79c1ee to af20448 Compare July 24, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants