From 9764de202b2da25517b8da76dcfe0c34a295df70 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Wed, 3 Nov 2021 10:44:39 +0100 Subject: [PATCH] pySim-shell: print newline on exit with CTRL+D When pySim-shell is exited using CTRL+D it does not print a newline. This means that the prompt of the OS shell shows up after the pySim-shell prompt. This is irretating. Lets print a new line on exit with CTRL+D so that everything looks straight. Change-Id: I88e58094b9badeaabd8502006e5e16f35eaa683e --- pySim-shell.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pySim-shell.py b/pySim-shell.py index 0be6f21f..037b843c 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -204,6 +204,10 @@ class PysimApp(cmd2.Cmd): """Display the intro banner""" self.poutput(self.intro) + def do_eof(self, _: argparse.Namespace) -> bool: + self.poutput("") + return self.do_quit('') + @cmd2.with_category(CUSTOM_CATEGORY) def do_equip(self, opts): """Equip pySim-shell with card"""