Skip to content
Permalink
Browse files

Use not so nice solution to fix crashing when backspacing in mono aft…

…er having resized CLI window
  • Loading branch information...
UnknownShadow200 committed Jun 4, 2017
1 parent 772f381 commit 87d4236baa241442b5e063d7542d81c4a84e1dd7
Showing with 11 additions and 1 deletion.
  1. +11 −1 ServerCLI/Program.cs
@@ -78,7 +78,17 @@ static class Program {
Console.WriteLine( "** Server is now ready. Type /Shutdown to exit safely. **" );

while( !Server.IsShuttingDown ) {
string cmd = Console.ReadLine();
string cmd = null;
try {
cmd = Console.ReadLine();
} catch (ArgumentException ex) {
// ArgumentException is raised on Mono when you type a message into a large CLI window,
// resize the CLI window to be smaller, and try to backspace when the message is biger
// than the smaller resized CLI window
Logger.Log(LogType.Error, "Error when reading input: " + ex);
continue;
}

if( cmd == null ) {
Console.WriteLine(
"*** Received EOF from console. You will not be able to type anything in console any longer. ***" );

0 comments on commit 87d4236

Please sign in to comment.
You can’t perform that action at this time.