sanitycheck: leave non-tty terminal unmodified on exit
The terminal configuration should not be reset on exit if sanitycheck's output is being directed to something that mediates the terminal control, such as a pager. Only do the reset if stdout is interactive. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
235a5e5e4b
commit
ab7773dae8
1 changed files with 2 additions and 1 deletions
|
@ -4365,4 +4365,5 @@ if __name__ == "__main__":
|
|||
try:
|
||||
main()
|
||||
finally:
|
||||
os.system("stty sane")
|
||||
if os.isatty(1): # stdout is interactive
|
||||
os.system("stty sane")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue