Skip to content

Commit

Permalink
Don't mix up pgroup and pid
Browse files Browse the repository at this point in the history
This is another case where we used pid when we meant pgroup.

Since 55b3c45, the assumption that
both are the same no longer holds in all cases, so this check was wrong.

Might fix #5663.
  • Loading branch information
faho committed Feb 25, 2019
1 parent a565913 commit 2418e1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ void reader_init() {
/// Restore the term mode if we own the terminal. It's important we do this before
/// restore_foreground_process_group, otherwise we won't think we own the terminal.
void restore_term_mode() {
if (getpid() != tcgetpgrp(STDIN_FILENO)) return;
if (getpgrp() != tcgetpgrp(STDIN_FILENO)) return;

if (tcsetattr(STDIN_FILENO, TCSANOW, &terminal_mode_on_startup) == -1 && errno == EIO) {
redirect_tty_output();
Expand Down

0 comments on commit 2418e1e

Please sign in to comment.