-
Notifications
You must be signed in to change notification settings - Fork 176
Open
Description
Sometimes the prompt (PS C:\Users\foo>) does not appear, but after I press enter, there will be 2 prompts.
import threading
from winpty import PtyProcess, PTY
def read_output(proc):
while proc.isalive():
output = proc.read()
print(output, end="")
proc = PtyProcess.spawn("powershell.exe")
# proc = PTY(80, 25)
# proc.spawn("cmd.exe")
thread = threading.Thread(target=read_output, args=(proc,))
thread.start()
while True:
command = input()
proc.write(command + "\r")
# proc.terminate()Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels