From 013a563ed0fc2cb400d914efffbeb8b87061673c Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 10 Mar 2021 09:38:16 +0100 Subject: [PATCH] Only modify terminal modes after config.fish if we have the terminal This tried fiddling with the terminal even if fish didn't own it, e.g. in fish -c 'sleep 5' & Fixes #7808. --- src/reader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/reader.cpp b/src/reader.cpp index 6b466a789..ce94a112c 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -1342,7 +1342,9 @@ void reader_init() { // Set up our fixed terminal modes once, // so we don't get flow control just because we inherited it. - term_donate(/* quiet */ true); + if (getpgrp() == tcgetpgrp(STDIN_FILENO)) { + term_donate(/* quiet */ true); + } // We do this not because we actually need the window size but for its side-effect of correctly // setting the COLUMNS and LINES env vars.