Follow-up for
3d97db8f3c3e86b70d09444965ebfddd051df39c
terminal_reset_ansi_req() would try to put terminal in nonblocking
mode temporarily again, hence just avoid the back and forth
and reset nonblocking as last step.
if (f->saved_stdout)
(void) tcsetattr(f->output_fd, TCSANOW, &f->saved_stdout_attr);
- /* STDIN/STDOUT should not be non-blocking normally, so let's reset it */
- (void) fd_nonblock(f->output_fd, false);
-
if (f->last_char_set && f->last_char != '\n') {
const char *s;
terminal_reset_ansi_seq(f->output_fd);
}
+ /* STDIN/STDOUT should not be non-blocking normally, so let's reset it */
+ (void) fd_nonblock(f->output_fd, false);
+
if (f->close_output_fd)
f->output_fd = safe_close(f->output_fd);
}