Skip to content

Instantly share code, notes, and snippets.

@creallfluharty
Created September 8, 2019 23:07
Show Gist options
  • Save creallfluharty/a409c2799bcdf444c8ba551946725a4e to your computer and use it in GitHub Desktop.
Save creallfluharty/a409c2799bcdf444c8ba551946725a4e to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import fcntl, sys, termios
tty_path = sys.argv[1]
with open(tty_path, 'wb') as tty_fd:
for line in sys.stdin.buffer:
for byte in line:
fcntl.ioctl(tty_fd, termios.TIOCSTI, bytes([byte]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment