From ba7832eb40e3d0b95714a3cf940e2f1d36c040f2 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 21 Sep 2022 09:48:39 -0400 Subject: [PATCH] Fix restoring blocking on exit When confetty/nodeconsole exits, correctly clear NONBLOCK flag is an idempotent way. --- confluent_client/bin/confetty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/confluent_client/bin/confetty b/confluent_client/bin/confetty index 2d53cdaf..0ce3cd5e 100755 --- a/confluent_client/bin/confetty +++ b/confluent_client/bin/confetty @@ -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