unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#39667: 26.2; Restarting a *shell* buffer breaks saving history
@ 2020-02-18 17:17 ndame
  2020-10-27 12:44 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: ndame @ 2020-02-18 17:17 UTC (permalink / raw)
  To: 39667

[-- Attachment #1: Type: text/plain, Size: 750 bytes --]


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.
 

[-- Attachment #2: Type: text/html, Size: 884 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#39667: 26.2; Restarting a *shell* buffer breaks saving history
  2020-02-18 17:17 bug#39667: 26.2; Restarting a *shell* buffer breaks saving history ndame
@ 2020-10-27 12:44 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-27 12:44 UTC (permalink / raw)
  To: ndame; +Cc: 39667

ndame <emacsuser@freemail.hu> writes:

> 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) ...

Yup.  This should now be fixed in Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-27 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 17:17 bug#39667: 26.2; Restarting a *shell* buffer breaks saving history ndame
2020-10-27 12:44 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).