From b9841375c9a3cdf44a47b47195b9969cc966d6d4 Mon Sep 17 00:00:00 2001 From: Edward Wright Date: Wed, 5 Jun 2019 00:10:08 -0400 Subject: [PATCH] don't wait for keypress after ctrl-x --- SimplySerial/SimplySerial.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SimplySerial/SimplySerial.cs b/SimplySerial/SimplySerial.cs index ed55e08..3ae231c 100644 --- a/SimplySerial/SimplySerial.cs +++ b/SimplySerial/SimplySerial.cs @@ -84,8 +84,8 @@ namespace SimplySerial // exit the program if CTRL-X was pressed if ((keyInfo.Key == ConsoleKey.X) && (keyInfo.Modifiers == ConsoleModifiers.Control)) { - serialPort.Close(); - ExitProgram("\nSession terminated by user via CTRL-X.", exitCode: 0); + Output("\nSession terminated by user via CTRL-X."); + ExitProgram(silent: true); } // properly process the backspace character @@ -168,7 +168,7 @@ namespace SimplySerial } else { - Console.WriteLine("No COM ports detected.\n"); + Console.WriteLine("\nNo COM ports detected.\n"); } ExitProgram(silent: true);