2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-26 23:32:10 +00:00

Have nodeconsole restore term on exit

This commit is contained in:
Jarrod Johnson 2018-08-02 10:07:41 -04:00
parent 81dd6202d3
commit 2972374da8

View File

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