/* With TERMP passed as NULL we get "\n" -> "\r\n". */
cfmakeraw (&termios);
+#ifdef FLUSHO
+ /* Workaround a readline deadlock bug in _get_tty_settings(). */
+ termios.c_lflag &= ~FLUSHO;
+#endif
child = forkpty (&amaster, childptyname, &termios, NULL);
switch (child)
{
assert (i == 0);
i = close (pipefd[1]);
assert (i == 0);
+
+ /* Do not replace STDIN as inferiors query its termios. */
+#if 0
+ i = close (STDIN_FILENO);
+ assert (i == 0);
+ i = open ("/dev/null", O_RDONLY);
+ assert (i == STDIN_FILENO);
+#endif
+
/* Do not setpgrp(2) in the parent process as the process-group
is shared for the whole sh(1) pipeline we could be a part
of. The process-group is set according to PID of the first