mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 01:22:00 +00:00
Fix restoring blocking on exit
When confetty/nodeconsole exits, correctly clear NONBLOCK flag is an idempotent way.
This commit is contained in:
parent
440fcf2663
commit
ba7832eb40
@ -635,7 +635,7 @@ def quitconfetty(code=0, fullexit=False, fixterm=True):
|
||||
global didconsole
|
||||
if fixterm or didconsole:
|
||||
currfl = fcntl.fcntl(sys.stdin.fileno(), fcntl.F_GETFL)
|
||||
fcntl.fcntl(sys.stdin.fileno(), fcntl.F_SETFL, currfl ^ os.O_NONBLOCK)
|
||||
fcntl.fcntl(sys.stdin.fileno(), fcntl.F_SETFL, currfl & ~os.O_NONBLOCK)
|
||||
if oldtcattr is not None:
|
||||
termios.tcsetattr(sys.stdin.fileno(), termios.TCSANOW, oldtcattr)
|
||||
# Request default color scheme, to undo potential weirdness of terminal
|
||||
|
Loading…
Reference in New Issue
Block a user