mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
properly return terminal in interactive mode when RAISE_SUBPROC_ERROR = True
This commit is contained in:
parent
8092e02f3b
commit
0131ec54df
2 changed files with 21 additions and 2 deletions
15
news/raisesub.rst
Normal file
15
news/raisesub.rst
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
**Added:** None
|
||||||
|
|
||||||
|
**Changed:** None
|
||||||
|
|
||||||
|
**Deprecated:** None
|
||||||
|
|
||||||
|
**Removed:** None
|
||||||
|
|
||||||
|
**Fixed:**
|
||||||
|
|
||||||
|
* Fixed issue where xonsh would fail to properly return the terminal prompt
|
||||||
|
(and eat up 100% CPU) after a failed subprocess command in interactive mode
|
||||||
|
if ``$RAISE_SUBPROC_ERROR = True``.
|
||||||
|
|
||||||
|
**Security:** None
|
|
@ -2149,8 +2149,12 @@ class CommandPipeline:
|
||||||
rtn is not None and
|
rtn is not None and
|
||||||
rtn > 0 and
|
rtn > 0 and
|
||||||
builtins.__xonsh_env__.get('RAISE_SUBPROC_ERROR')):
|
builtins.__xonsh_env__.get('RAISE_SUBPROC_ERROR')):
|
||||||
raise subprocess.CalledProcessError(rtn, spec.cmd,
|
try:
|
||||||
output=self.output)
|
raise subprocess.CalledProcessError(rtn, spec.cmd,
|
||||||
|
output=self.output)
|
||||||
|
finally:
|
||||||
|
# this is need to get a working terminal in interactive mode
|
||||||
|
self._return_terminal()
|
||||||
|
|
||||||
#
|
#
|
||||||
# Properties
|
# Properties
|
||||||
|
|
Loading…
Add table
Reference in a new issue