Open Astn opened 7 months ago
few years back I went down this route when I wanted to try and see what running spectre.console in blazor would look like. I came up with a pretty similar solution to this with a fork and it worked well. I'd be in favor
here's that repo for what its worth - https://github.com/phil-scott-78/try-spectre/blob/main/src/TrySpectre/Pages/Index.razor
Is Your Feature Request Related to a Problem? Please Describe.
I've encountered an issue where I am unable to bind my input back to the IAnsiConsole when utilizing AnsiConsoleFactory. My application is a Blazor app, meaning the input mechanism I employ does not originate from StandardInput. Instead, it's an adaptation of browser-sourced keyboard events.
Describe the Solution You'd Like
I propose the introduction of the ability to provide a custom implementation of IAnsiConsoleInput through a property in AnsiConsoleSettings. This adjustment would enable the construction of my console using AnsiConsoleFactory, allowing for more flexibility and integration with my Blazor application.
Describe Alternatives You've Considered
Initially, I attempted to develop my own version of AnsiConsoleFactory. However, I quickly discovered a complex chain of dependencies among classes designated as internal, which significantly hampers the practicality of leveraging the extensive utility offered by the built-in AnsiConsoleFactory.
Additional Context
I discovered that with a few minor modifications, it was possible to integrate my custom input in a manner that is fully backward compatible.
Here is the approach I took: https://github.com/Astn/spectre.console/commit/68fc35d99710e4dd9aada550dc781adb95f0164f
Thoughts?
Please upvote :+1: this issue if you are interested in it.