mirror of
https://github.com/xcat2/confluent.git
synced 2025-02-27 07:41:13 +00:00
Have nodeconsole restore term on exit
This commit is contained in:
parent
81dd6202d3
commit
2972374da8
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user