mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 06:41:14 -03:00
No longer put fish in own process group on startup
As discussed in #3805, this patch disables assigning fish to its own process group at startup. This was trialled in #4349 alongside other pgrp fixes which introduced additional problems, but this particular fix seems to be OK. Fixes #3805 and works around Microsoft/BashOnWindows#1653
This commit is contained in:
@@ -1626,30 +1626,8 @@ static void reader_interactive_init() {
|
|||||||
signal_set_handlers();
|
signal_set_handlers();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put ourselves in our own process group.
|
|
||||||
shell_pgid = getpid();
|
|
||||||
if (getpgrp() != shell_pgid && setpgid(shell_pgid, shell_pgid) < 0) {
|
|
||||||
debug(0, _(L"Couldn't put the shell in its own process group"));
|
|
||||||
wperror(L"setpgid");
|
|
||||||
exit_without_destructors(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Grab control of the terminal.
|
|
||||||
if (tcsetpgrp(STDIN_FILENO, shell_pgid) == -1) {
|
|
||||||
if (errno == ENOTTY) redirect_tty_output();
|
|
||||||
debug(0, _(L"Couldn't grab control of terminal"));
|
|
||||||
wperror(L"tcsetpgrp");
|
|
||||||
exit_without_destructors(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
invalidate_termsize();
|
invalidate_termsize();
|
||||||
|
|
||||||
// Set the new modes.
|
|
||||||
if (tcsetattr(0, TCSANOW, &shell_modes) == -1) {
|
|
||||||
if (errno == EIO) redirect_tty_output();
|
|
||||||
wperror(L"tcsetattr");
|
|
||||||
}
|
|
||||||
|
|
||||||
env_set_one(L"_", ENV_GLOBAL, L"fish");
|
env_set_one(L"_", ENV_GLOBAL, L"fish");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user