From 7c4891407fdd1d063277ffa881f465add7df4b2b Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Thu, 19 Nov 2020 19:15:51 -0800 Subject: [PATCH] Remove restore_attrs from terminal_return_from_job_group function Previously this parameter was used to more-eagerly restore the terminal mode. This was the basis for #2214. However now we restore the mode from the reader instead, so we can remove this unused parameter. --- src/proc.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/proc.cpp b/src/proc.cpp index f49e3468f..d1e8b898a 100644 --- a/src/proc.cpp +++ b/src/proc.cpp @@ -905,7 +905,7 @@ int terminal_maybe_give_to_job_group(const job_group_t *jg, bool continuing_from /// Returns control of the terminal to the shell, and saves the terminal attribute state to the job /// group, so that we can restore the terminal ownership to the job at a later time. -static bool terminal_return_from_job_group(job_group_t *jg, bool restore_attrs) { +static bool terminal_return_from_job_group(job_group_t *jg) { errno = 0; auto pgid = jg->get_pgid(); if (!pgid.has_value()) { @@ -960,14 +960,8 @@ void job_t::continue_job(parser_t &parser, bool in_foreground) { bool term_transferred = false; cleanup_t take_term_back([&] { if (term_transferred) { - // Should we restore the terminal attributes? - // Historically we have done this conditionally only if we sent SIGCONT. - // TODO: rationalize what the right behavior here is. - bool restore_attrs = send_sigcont; - // Issues of interest: - // https://github.com/fish-shell/fish-shell/issues/121 - // https://github.com/fish-shell/fish-shell/issues/2114 - terminal_return_from_job_group(this->group.get(), restore_attrs); + // Issues of interest include #121 and #2114. + terminal_return_from_job_group(this->group.get()); } });