mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
Catch system exits
This commit is contained in:
parent
c4795671e0
commit
14a7dfe579
2 changed files with 2 additions and 2 deletions
|
@ -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"):
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue