chiark / gitweb /
add TIOCNOTTY ioctl wrapper
[bin.git] / tiocnotty
diff --git a/tiocnotty b/tiocnotty
new file mode 100755 (executable)
index 0000000..1bf635e
--- /dev/null
+++ b/tiocnotty
@@ -0,0 +1,15 @@
+#! /usr/bin/python
+
+import sys
+import os
+import fcntl
+import termios
+
+try:
+    tty = open('/dev/tty')
+    fcntl.ioctl(tty, termios.TIOCNOTTY)
+    tty.close()
+except IOError:
+    pass
+
+os.execvp(sys.argv[1], sys.argv[1:])