Update terminalManagement

This commit is contained in:
chrys87 2017-08-24 10:48:25 +02:00 committed by GitHub
parent 5c2357cc8a
commit 640bffa05b

View File

@ -46,7 +46,7 @@ def open_terminal(command="bash", columns=80, lines=25):
return Terminal(columns, lines, p_out), p_pid, p_out return Terminal(columns, lines, p_out), p_pid, p_out
def HandleTerminal(): def HandleTerminal():
debug = True debug = False
running = True running = True
#attr = termios.tcgetattr(sys.stdin.fileno()) #attr = termios.tcgetattr(sys.stdin.fileno())
try: try:
@ -57,7 +57,7 @@ def HandleTerminal():
#termios.tcdrain(p_pid) #termios.tcdrain(p_pid)
#termios.tcdrain(0) #termios.tcdrain(0)
while running: while running:
time.sleep(0.04) #time.sleep(0.04)
r, w, x = select.select([sys.stdin, p_out],[],[]) r, w, x = select.select([sys.stdin, p_out],[],[])
if r == []: if r == []:
continue continue
@ -90,9 +90,7 @@ def HandleTerminal():
running = False running = False
break break
#msgBytes = os.read(sys.stdin.fileno(), 1) #msgBytes = os.read(sys.stdin.fileno(), 1)
print('1')
terminal.feed(msgBytes) terminal.feed(msgBytes)
print('2')
os.write(p_out.fileno(), msgBytes) os.write(p_out.fileno(), msgBytes)
if debug: if debug:
print('after stdin') print('after stdin')