From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: ndame Newsgroups: gmane.emacs.bugs Subject: bug#39667: 26.2; Restarting a *shell* buffer breaks saving history Date: Tue, 18 Feb 2020 17:17:47 +0000 (GMT) Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1223_1213870708.1582046267246" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="48506"; mail-complaints-to="usenet@ciao.gmane.io" To: 39667@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 18 18:22:15 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j46Za-000CV0-9H for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Feb 2020 18:22:14 +0100 Original-Received: from localhost ([::1]:38942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j46ZZ-0006Bb-Ad for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Feb 2020 12:22:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52669) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j46ZP-00067P-S4 for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 12:22:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j46ZO-0003gA-Qj for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 12:22:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35240) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j46ZO-0003g1-NM for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 12:22:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j46ZO-0007N3-2z for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 12:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: ndame Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Feb 2020 17:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39667 X-GNU-PR-Package: emacs X-Debbugs-Original-To: "bug-gnu-emacs@gnu.org" Original-Received: via spool by submit@debbugs.gnu.org id=B.158204649228292 (code B ref -1); Tue, 18 Feb 2020 17:22:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Feb 2020 17:21:32 +0000 Original-Received: from localhost ([127.0.0.1]:41213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j46Yt-0007MG-TM for submit@debbugs.gnu.org; Tue, 18 Feb 2020 12:21:32 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:52940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j46Yr-0007M6-RG for submit@debbugs.gnu.org; Tue, 18 Feb 2020 12:21:30 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52612) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j46Yq-0004qh-PW for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 12:21:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j46Yp-0003PT-OD for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 12:21:28 -0500 Original-Received: from fmfe22.onbox.hu ([46.107.16.227]:13492 helo=web-out.onbox.hu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j46Yp-0003IG-Eq for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 12:21:27 -0500 X-fm-smtp-source: yes Original-Received: from localhost (localhost [178.164.166.72]) by web-out.onbox.hu (Postfix) with SMTP id 48MSLj5cJJzZyq for ; Tue, 18 Feb 2020 18:21:17 +0100 (CET) X-AccountId: 57978162 X-Originating-Ip: 178.164.166.72 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedrjeekgddutdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpucfhtffggffotefknfenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffkufggtgfvihesrgdtregstddtudenucfhrhhomhepnhgurghmvgcuoegvmhgrtghsuhhsvghrsehfrhgvvghmrghilhdrhhhuqeenucfkphepudejkedrudeigedrudeiiedrjedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheppdhinhgvthepudejkedrudeigedrudeiiedrjedvpdhmrghilhhfrhhomhepvghmrggtshhushgvrhesfhhrvggvmhgrihhlrdhhuhdprhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhg X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:176201 Archived-At: ------=_Part_1223_1213870708.1582046267246 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I tried it on windows. Start M-x shell. Check the value of comint-input-ring-file-name in the buffer. It's "~/.history" and the input ring has values read from this file. Exit the shell with Ctrl+D. The shell exits, the buffer remains. Restart the shell with M-x shell. Check the value of comint-input-ring-file-name. It's nil, because comint-input-ring has already has a value from the previous invocation, so shell-mode skips the whole history setup: (when (ring-empty-p comint-input-ring) ... Without the setup shell-write-history-on-exit is not called and if it were it would do nothing, because comint-input-ring-file-name is nil. Therefore the restarted *shell* buffer won't save commands made in it to history. =C2=A0 ------=_Part_1223_1213870708.1582046267246 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
I tried it on windows.

Start M-x shell.

Check the value of comint-input-ring-file-name in the buffer. It's
"~/.history" and the input ring has values read from this file.

Exit the shell with Ctrl+D. The shell exits, the buffer remains.

Restart the shell with M-x shell.

Check the value of comint-input-ring-file-name. It's nil, because
comint-input-ring has already has a value from the previous
invocation, so shell-mode skips the whole history setup: (when
(ring-empty-p comint-input-ring) ...

Without the setup shell-write-history-on-exit is not called and if it
were it would do nothing, because comint-input-ring-file-name is nil.

Therefore the restarted *shell* buffer won't save commands made in it
to history.
  ------=_Part_1223_1213870708.1582046267246--