summaryrefslogtreecommitdiffstats
path: root/Lib/pty.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pty.py')
-rw-r--r--Lib/pty.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/pty.py b/Lib/pty.py
index fae162d..889113c 100644
--- a/Lib/pty.py
+++ b/Lib/pty.py
@@ -118,6 +118,10 @@ def fork():
if (slave_fd > STDERR_FILENO):
os.close (slave_fd)
+ # Explicitly open the tty to make it become a controlling tty.
+ tmp_fd = os.open(os.ttyname(STDOUT_FILENO), os.O_RDWR)
+ os.close(tmp_fd)
+
# Parent and child process.
return pid, master_fd