Catch system exits

This commit is contained in:
Anthony Scopatz 2017-02-25 01:06:36 -05:00
parent c4795671e0
commit 14a7dfe579
2 changed files with 2 additions and 2 deletions

View file

@ -156,7 +156,7 @@ class PromptToolkitShell(BaseShell):
else:
line = self.precmd(line)
self.default(line)
except KeyboardInterrupt:
except (KeyboardInterrupt, SystemExit):
self.reset_buffer()
except EOFError:
if builtins.__xonsh_env__.get("IGNOREEOF"):

View file

@ -468,7 +468,7 @@ class ReadlineShell(BaseShell, cmd.Cmd):
while not builtins.__xonsh_exit__:
try:
self._cmdloop(intro=intro)
except KeyboardInterrupt:
except (KeyboardInterrupt, SystemExit):
print() # Gives a newline
fix_readline_state_after_ctrl_c()
self.reset_buffer()