bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pwd and prompt don't update after deleting current working directory


From: Eduardo Bustamante
Subject: Re: pwd and prompt don't update after deleting current working directory
Date: Thu, 11 Jul 2024 19:40:27 -0700

On Thu, Jul 11, 2024 at 7:32 PM David Hedlund <davidh@gnu.org> wrote:
(...)

> I understand. So the feature request should be an option "-b" (for
> bounce out of the directory when deleted) for example?
>

It'd be helpful to know about the use cases for such feature though.

My assumptions:

- This would only be useful in interactive sessions. Portable scripts would
not have access to this feature, and so in these cases the script writer
must explicitly consider the case where $PWD is unlinked while the process
is running. Or decide that it's not worth handling.

- In an interactive session: What are the conditions that lead to a
directory being removed without the user's knowledge?

- Also, what's wrong with letting a user deal with this by issuing `cd ..`?
Surely, this doesn't happen frequently enough that it merits increasing the
complexity of Bash to handle it automatically.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]