message: Process: added missing setup of terminal settings.
diff: @@ -109,6 +109,51 @@ namespace {
  } // anonymous namespace
  #endif
  +#if !defined(_MSC_VER)
  +static termios getTerminalSettings(int fd)
  +{
  + termios tio;
  + tcgetattr(fd, &tio);
  + return tio;
  +}
  +
  +static termios constructTerminalSettings(int fd)
  +{
  + auto tio = getTerminalSettings(fd);
  +
  + // input flags
  + tio.c_iflag |= IGNBRK; // Ignore Break condition on input.
  + tio.c_iflag &= ~IXON; // Disable CTRL-S / CTRL-Q on output.
  + tio.c_iflag &= ~IXOFF; // Disable CTRL-S / CTRL-Q on input.
  + tio.c_iflag &= ~ICRNL; // Ensure CR isn't translated to NL.
  + tio.c_iflag &= ~INLCR; // Ensure NL isn't translated to CR.
  + tio.c_iflag &= ~IGNCR; // Ensure CR isn't ignored.
  + tio.c_iflag &= ~IMAXBEL; // Ensure beeping on full input buffer isn't enabled.
  + tio.c_iflag &= ~ISTRIP; // Ensure stripping of 8th bit on input isn't enabled.
  +
  + // output flags
  + tio.c_oflag &= ~OPOST; // Don't enable implementation defined output processing.
  + tio.c_oflag &= ~ONLCR; // Don't map NL to CR-NL.
  + tio.c_oflag &= ~OCRNL; // Don't map CR to NL.
  + tio.c_oflag &= ~ONLRET; // Don't output CR.
  +
  + // control flags
  +
  + // local flags
  + tio.c_lflag &= ~IEXTEN; // Don't enable implementation defined input processing.
  + tio.c_lflag &= ~ICANON; // Don't enable line buffering (Canonical mode).
  + tio.c_lflag &= ~ECHO; // Don't echo input characters.
  + tio.c_lflag &= ~ISIG; // Don't generate signal upon receiving characters for
  + // INTR, QUIT, SUSP, DSUSP.
  +
  + // special characters
  + tio.c_cc[VMIN] = 1; // Report as soon as 1 character is available.
  + tio.c_cc[VTIME] = 0; // Disable timeout (no need).
  +
  + return tio;
  +}
  +#endif
  +
  Process::Process(
  PseudoTerminal& _pty,
  string const& _path,
  @@ -127,6 +172,11 @@ Process::Process(
  case 0: // in child
  {
  close(_pty.master());
  +
  + auto tio = constructTerminalSettings(_pty.master());
  + if (tcsetattr(_pty.master(), TCSANOW, &tio) == 0)
  + tcflush(_pty.master(), TCIOFLUSH);
  +
  if (login_tty(_pty.slave()) < 0)
  _exit(EXIT_FAILURE);
  