Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Tomas Janousek Newsgroups: gnu.bash.bug Subject: Re: History not saved when closing terminal while bash is sourcing a script Date: Thu, 8 Aug 2019 10:13:35 +0200 Lines: 25 Approved: bug-bash@gnu.org Message-ID: References: <20190803150529.u5lf2tzvgo5sie7m@nomi.cz> <2b96a07b-c679-ea90-a714-056c81ee0c97@case.edu> <20190808081335.vlcr2ele27hoogue@nomi.cz> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1565252026 15590 209.51.188.17 (8 Aug 2019 08:13:46 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: Chet Ramey Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nomi.cz; s=201904; t=1565252016; bh=9DBkyqVSD7UkbdDVJ1ZJwFRlWO6wUToUtbjUCI+ZGCg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m7KKo/2IIjX8HxDes2CHuBZdCHFszJMKuRbuwS5viXq77gl8h/aok/NmU1pieJCi5 qLkdYIMQKD1QFR92zqodmWhr6xlqk5KPqo1caJhKgQ+L1wXwX3S7XHHqK0RHneseMC 3h9XqNS72VEWIORdMVsVuttqG5BgcTaIiUp+ta3L/pgmzEO6RVIQzgqHIjAWYvyA+X CXUrhpS2EXolH5VKHLQyXd4CFRMVqnazWF/MYuR5nqO5P+rKHT5w3S3Ovqz95oL2Pp z676ao6KlwGkf3pI5Ezvslr4zore2gthVINhU5e1wW6529ACFTCcWtcqfP44GpmhLG 8WQrcTe5odO0g== Content-Disposition: inline In-Reply-To: <2b96a07b-c679-ea90-a714-056c81ee0c97@case.edu> User-Agent: NeoMutt/20180716 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a01:430:1:1::1 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <20190808081335.vlcr2ele27hoogue@nomi.cz> X-Mailman-Original-References: <20190803150529.u5lf2tzvgo5sie7m@nomi.cz> <2b96a07b-c679-ea90-a714-056c81ee0c97@case.edu> Xref: csiph.com gnu.bash.bug:15309 Hi, On Sun, Aug 04, 2019 at 01:42:12PM -0400, Chet Ramey wrote: > On 8/3/19 11:05 AM, Tomas Janousek wrote: > I don't have or use tmux, but I'm going to guess that `kill-window' sen= ds > a SIGHUP to the process group and follows it up with a SIGKILL. The > `source' turns off saving to history -- the `source' gets saved in the > history list, not the commands it runs -- and is still running when the > SIGHUP arrives. The SIGHUP causes the shell to exit without saving the > history because history is turned off when the signal handler runs. So this means `source' shouldn't ever be used in interactive shells if on= e cares about their shell history, right? I'll file an issue in the Midnigh= t Commander bug tracker to use a shell function instead. It might be worth documenting the behaviour, though, as it is quite suprising -- shell func= tions don't need to turn off saving to history, so why should `source'? --=20 Tom=C3=A1=C5=A1 Janou=C5=A1ek, a.k.a. Pivn=C3=ADk, a.k.a. Liskni_si, http= ://work.lisk.in/