mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-19 14:51:13 -03:00
Don't mix up pgroup and pid
This is another case where we used pid when we meant pgroup.
Since 55b3c45f95, the assumption that
both are the same no longer holds in all cases, so this check was wrong.
Might fix #5663.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user