2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 02:52:07 +00:00

Fix restoring blocking on exit

When confetty/nodeconsole exits, correctly
clear NONBLOCK flag is an idempotent way.
This commit is contained in:
Jarrod Johnson 2022-09-21 09:48:39 -04:00
parent 440fcf2663
commit ba7832eb40

View File

@ -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