Retain NL to NLCR conversion on the real tty and skip it on the pty

we allocate.  That way, if stdout is not a pty there are no extra carriage
returns.
This commit is contained in:
Todd C. Miller
2009-09-30 02:12:35 +00:00
parent e6331c0773
commit fe9fc5ad1b
3 changed files with 28 additions and 11 deletions

View File

@@ -237,12 +237,12 @@ script_setup()
log_error(USE_ERRNO, "Can't get pty");
/* Copy terminal attrs from stdin -> pty slave. */
if (!term_copy(STDIN_FILENO, script_fds[SFD_SLAVE])) {
if (!term_copy(STDIN_FILENO, script_fds[SFD_SLAVE], 0)) {
log_error(USE_ERRNO, "Can't copy terminal attributes");
}
sync_winsize(STDIN_FILENO, script_fds[SFD_SLAVE]);
if (!term_raw(STDIN_FILENO))
if (!term_raw(STDIN_FILENO, 1))
log_error(USE_ERRNO, "Can't set terminal to raw mode");
/*