From 2972374da8797a2844696088aa530a8460279b0d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 2 Aug 2018 10:07:41 -0400 Subject: [PATCH] Have nodeconsole restore term on exit --- confluent_client/bin/confetty | 2 ++ 1 file changed, 2 insertions(+) diff --git a/confluent_client/bin/confetty b/confluent_client/bin/confetty index 86ef1aea..a26f426e 100755 --- a/confluent_client/bin/confetty +++ b/confluent_client/bin/confetty @@ -585,6 +585,7 @@ def startconsole(nodename): tty.setraw(sys.stdin.fileno()) currfl = fcntl.fcntl(sys.stdin.fileno(), fcntl.F_GETFL) fcntl.fcntl(sys.stdin.fileno(), fcntl.F_SETFL, currfl | os.O_NONBLOCK) + sys.stdout.write('\x1b[?1049h\x1b[H') inconsole = True @@ -593,6 +594,7 @@ def quitconfetty(code=0, fullexit=False, fixterm=True): global currconsole global didconsole if fixterm or didconsole: + sys.stdout.write('\x1b[?1049l') currfl = fcntl.fcntl(sys.stdin.fileno(), fcntl.F_GETFL) fcntl.fcntl(sys.stdin.fileno(), fcntl.F_SETFL, currfl ^ os.O_NONBLOCK) if oldtcattr is not None: