You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Right now the only way to implement a custom input for a IAnsiConsole is to re-implement all of IAnsiConsole. Instead I would like to be able to pass in a IAnsiInput into AnsiConsole.Create and use the rest of the library as-is.
Describe the solution you'd like
Instead of always using DefaultInput(profile), look for an existing IAnsiInput in the AnsiConsoleSettings and use that, this is the same behavior as is already done with IAnsiOutput
Describe alternatives you've considered
I went down the path of re-implementing IAnsiConsole but that's a lot of pain, as so much behavior already exists in the internal sealed classes in the library. I'd much rather just provide a custom I/O to the console.
We could also extend DefaultConsole but that doesn't seem to be the right place for this change.
Additional context
To be clear, if you use AnsiConsole.Create it always calls the AnsiConsoleFactory which creates a AnsiConsoleFacade that always uses a DefaultInput which always calls System.Console.*. There's no extension point in this whole chain.
Please upvote 👍 this issue if you are interested in it.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Right now the only way to implement a custom input for a
IAnsiConsole
is to re-implement all ofIAnsiConsole
. Instead I would like to be able to pass in aIAnsiInput
intoAnsiConsole.Create
and use the rest of the library as-is.I whipped up a PR for this: halgari/spectre.console@main...halgari:spectre.console:configurable-input but the PR template said to make an issue first, so here it is.
Describe the solution you'd like
Instead of always using
DefaultInput(profile)
, look for an existingIAnsiInput
in theAnsiConsoleSettings
and use that, this is the same behavior as is already done withIAnsiOutput
Describe alternatives you've considered
I went down the path of re-implementing
IAnsiConsole
but that's a lot of pain, as so much behavior already exists in the internal sealed classes in the library. I'd much rather just provide a custom I/O to the console.We could also extend
DefaultConsole
but that doesn't seem to be the right place for this change.Additional context
To be clear, if you use
AnsiConsole.Create
it always calls the AnsiConsoleFactory which creates aAnsiConsoleFacade
that always uses aDefaultInput
which always callsSystem.Console.*
. There's no extension point in this whole chain.Please upvote 👍 this issue if you are interested in it.
The text was updated successfully, but these errors were encountered: