Skip to content


Use not so nice solution to fix crashing when backspacing in mono aft…
Browse files Browse the repository at this point in the history
…er having resized CLI window
  • Loading branch information
UnknownShadow200 committed Jun 4, 2017
1 parent 772f381 commit 87d4236
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ServerCLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

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

0 comments on commit 87d4236

Please sign in to comment.