Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConsoleModeCommand limited to 256 chars #19

Open
WilkoSki opened this issue Dec 1, 2014 · 4 comments
Open

ConsoleModeCommand limited to 256 chars #19

WilkoSki opened this issue Dec 1, 2014 · 4 comments

Comments

@WilkoSki
Copy link

WilkoSki commented Dec 1, 2014

We've recently started using ManyConsole and it's saved us writing the same boiler plate code over and over again.

One small issue that we've encountered is that when in console mode it appears that the command is limited to 256 chars, is this by design or is the some configuration setting that can be changed ?

@fschwiet
Copy link
Owner

fschwiet commented Dec 1, 2014

I wasn't aware of that limitation, so it would need to be debugged to find the source. I doubt there is a configuration option.

@WilkoSki
Copy link
Author

WilkoSki commented Dec 1, 2014

It could be down to the command line parser using a WinApi call. I'll look at the MSDN docs.

Sent from my iPhone

On 1 Dec 2014, at 19:05, fschwiet [email protected] wrote:

I wasn't aware of that limitation, so it would need to be debugged to find the source. I doubt there is a configuration option.


Reply to this email directly or view it on GitHub.

@WilkoSki
Copy link
Author

WilkoSki commented Dec 2, 2014

The problem is caused by the ConsoleModeCommand class using Console.In to return a TextReader then calling the ReadLine method. By default the this is limited to a 255 char line length.

You could use Console.OpenStandardInput instead and wrap it in a StreamReader, the overload allows you to specify a buffer size. You could expose the buffer size as a property of the ConsoleModeCommand. When you come to read from the input stream use the Read method instead of ReadLine.

e.g. _inputStream.Read(buffer, 0, ReadLineBufferSize);

@fschwiet
Copy link
Owner

fschwiet commented Dec 3, 2014

Thanks for the notes. I'm not really in the best place to run the tests and deploy (in Mexico with a Macbook, why did I powershell these things..). If there was a pull request with test I might figure out how to release a new version while traveling.

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

No branches or pull requests

2 participants