Only donate term if we're interactive *and* have the terminal

As it turns out otherwise fish would hang when sddm starts it as the login shell.

Belongs to #7842.
This commit is contained in:
Fabian Homborg 2021-03-22 16:57:55 +01:00
parent 66a873ad23
commit 7f7cfcf339

View file

@ -1342,7 +1342,8 @@ void reader_init() {
// Set up our fixed terminal modes once,
// so we don't get flow control just because we inherited it.
if (is_interactive_session()) {
if (is_interactive_session() &&
getpgrp() == tcgetpgrp(STDIN_FILENO)) {
term_donate(/* quiet */ true);
}