diff --git a/LiteDB.Shell/Shell/InputCommand.cs b/LiteDB.Shell/Shell/InputCommand.cs index c68d74846..3f807bb6e 100644 --- a/LiteDB.Shell/Shell/InputCommand.cs +++ b/LiteDB.Shell/Shell/InputCommand.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Diagnostics; namespace LiteDB.Shell { @@ -24,7 +23,16 @@ public string ReadCommand() Console.ForegroundColor = ConsoleColor.White; Console.Write("> "); - var cmd = this.ReadLine().Trim(); + var cmd = this.ReadLine(); + + if (cmd == null) + { + this.AutoExit = true; + this.Running = false; + return ""; + } + + cmd = cmd.Trim(); // single line only for shell commands if (ShellProgram.GetCommand(cmd) == null)