↧
Answer by Bruno Bronosky for Unable to fake terminal input with termios.TIOCSTI
I took the answer from @Ulfalizer and expanded it a bit to be a complete and usable app.import sysimport fcntlimport termiosimport argparseparser = argparse.ArgumentParser()parser.add_argument('tty',...
View ArticleAnswer by Ulfalizer for Unable to fake terminal input with termios.TIOCSTI
TIOCSTI is an ioctl (documented in tty_ioctl(4)), not a terminal setting, so you can't use tcsetattr() -- you need to feed each character of the fake input to ioctl() instead. Never had to do ioctl's...
View ArticleUnable to fake terminal input with termios.TIOCSTI
Most of the code samples I've seen are trying to read from stdin without local echo. To do this they modify the "local modes" flag to remove the setting to "Echo input characters". I thought I could...
View Article