Subject: bug#60968: 30.0.50; M-x shell keeps an old default-directory

From: Manuel Giraud <[email-masked]>
Date: Fri, 20 Jan 2023 21:03:37 +0100

Michael Albinus <[email-masked]> writes:

[...]

> This is the specified behavior of the `shell' command. From the
> docstring:
>
> If BUFFER exists but shell process is not running, make new shell.
> If BUFFER exists and shell process is running, just switch to BUFFER.
>
>
> That is, the shell buffer is reused, even if you have interrupted with
> C-g, and the shell didn't start yet. And so its default-directory.
>
> If you want another buffer (and another shell therefore), the following
> from the docstring is relevant:
>
> Interactively, a prefix arg means to prompt for BUFFER.
>
> So your use case needs "C-u M-x shell". Or you delete the shell buffer
> after you have interrupted with C-g.

Yes, you're right I'd better need to fix my usage because the "using an
existing shell buffer" feature is valuable.  Sorry for this bug report
then.
-- 
Manuel Giraud