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

2024-07-11 Thread Phi Debian
Oops I forgot the reply to all in my reply to @David Hedlund I was on the same tune as you @g...@wooledge.org . == On Fri, Jul 12, 2024 at 12:14 AM David Hedlund wrote: > > > When a directory is deleted while the user is inside it, the terminal > should automati

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

2024-07-11 Thread Greg Wooledge
On Fri, Jul 12, 2024 at 10:26:54 +0700, Robert Elz wrote: > Is it supposed to continually run "stat($PWD, ...)" forever (after > all the directory might be removed from elsewhere while you're in > the middle of typing a command - what do you expect to happen then?) It's even worse: let's say a new

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

2024-07-11 Thread Robert Elz
Date:Fri, 12 Jul 2024 03:53:01 +0200 From:David Hedlund Message-ID: <820e6ee2-7444-4a01-991a-3530c2591...@gnu.org> | Thanks, Lawrence! I found this discussion helpful and believe it would | be a valuable feature to add. Can I submit this as a feature request? Yo

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

2024-07-11 Thread Lawrence Velázquez
On Thu, Jul 11, 2024, at 9:53 PM, David Hedlund wrote: > On 2024-07-12 00:54, Lawrence Velázquez wrote: >> (You're free to argue that bash *should* behave this way, but that's >> a feature request, not a bug report. And having bash automatically >> update its working directory based on filesystem

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

2024-07-11 Thread Eduardo Bustamante
On Thu, Jul 11, 2024 at 7:32 PM David Hedlund 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 u

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

2024-07-11 Thread Eduardo Bustamante
On Thu, Jul 11, 2024 at 7:20 PM David wrote: (...) > Hi, I disagree, and I think if you understand better why this occurs, you > will understand why knowledgable users will disagree, and you will > change your opinion. > I concur. The requested feature changes behavior in a backwards-incompatibl

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

2024-07-11 Thread David Hedlund
On 2024-07-12 04:19, David wrote: n Thu, 11 Jul 2024 at 22:14, David Hedlund wrote: When a directory is deleted while the user is inside it, the terminal should automatically return to the parent directory. Hi, I disagree, and I think if you understand better why this occurs, you will underst

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

2024-07-11 Thread David
n Thu, 11 Jul 2024 at 22:14, David Hedlund wrote: > When a directory is deleted while the user is inside it, the terminal > should automatically return to the parent directory. Hi, I disagree, and I think if you understand better why this occurs, you will understand why knowledgable users will d

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

2024-07-11 Thread David Hedlund
On 2024-07-12 00:54, Lawrence Velázquez wrote: On Thu, Jul 11, 2024, at 6:08 PM, David Hedlund wrote: Expected behaviour When a directory is deleted while the user is inside it, the terminal should automatically return to the parent directory. ``` user@domain:~/test$ mkdir ~/test && cd ~

Re: Local variable can not unset within shell functions

2024-07-11 Thread Robert Elz
Date:Thu, 11 Jul 2024 16:01:20 -0400 From:Chet Ramey Message-ID: <2739cbbc-d44e-423e-869e-f2884c148...@case.edu> | The bug in bash-4.2 was that [...] | This would have been clearer to see (and more misleading) if the variable | x also had a value at the global

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

2024-07-11 Thread Lawrence Velázquez
On Thu, Jul 11, 2024, at 6:08 PM, David Hedlund wrote: > Expected behaviour > When a directory is deleted while the user is inside it, the terminal > should automatically return to the parent directory. > > ``` > user@domain:~/test$ mkdir ~/test && cd ~/test && touch foo && ls > foo > user@do

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

2024-07-11 Thread David Hedlund
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall uname output: Linux blues-System-Pr

Re: Local variable can not unset within shell functions

2024-07-11 Thread Chet Ramey
On 7/11/24 9:42 AM, Dr. Werner Fink wrote: Hi, I've a report that with later bash the following which works in bash-4.2 x () { local x=y declare -p x echo $x unset x declare -p x echo $x } with linux-40cm:~ # x () { > local x=y > declare -p x > echo $x >

Re: Local variable can not unset within shell functions

2024-07-11 Thread Greg Wooledge
On Thu, Jul 11, 2024 at 15:39:41 -0400, Lawrence Velázquez wrote: > I won't speculate about the issue, but your subject goes too far. > The variable really is unset here: > > % cat /tmp/x.bash > x() { > local x=y > declare -p x > echo "x is ${x

Re: Local variable can not unset within shell functions

2024-07-11 Thread Lawrence Velázquez
On Thu, Jul 11, 2024, at 9:42 AM, Dr. Werner Fink wrote: > I've a report that with later bash the following which works in bash-4.2 > > [...] > > linux-40cm:~ # x () { > > local x=y > > declare -p x > > echo $x > > unset x > > declare -p x > > echo $x > > } > linux-40cm:~ # x

Re: Local variable can not unset within shell functions

2024-07-11 Thread alex xmb sw ratchev
On Thu, Jul 11, 2024, 16:34 alex xmb sw ratchev wrote: > > > On Thu, Jul 11, 2024, 15:42 Dr. Werner Fink wrote: > >> Hi, >> >> I've a report that with later bash the following which works in bash-4.2 >> >> x () { >> local x=y >> declare -p x >> echo $x >> unset x >> declare -p x >>

Re: Local variable can not unset within shell functions

2024-07-11 Thread alex xmb sw ratchev
On Thu, Jul 11, 2024, 15:42 Dr. Werner Fink wrote: > Hi, > > I've a report that with later bash the following which works in bash-4.2 > > x () { > local x=y > declare -p x > echo $x > unset x > declare -p x > echo $x > } > > with > > linux-40cm:~ # x () { > > local x=y > > de

Local variable can not unset within shell functions

2024-07-11 Thread Dr. Werner Fink
Hi, I've a report that with later bash the following which works in bash-4.2 x () { local x=y declare -p x echo $x unset x declare -p x echo $x } with linux-40cm:~ # x () { > local x=y > declare -p x > echo $x > unset x > declare -p x > echo $x > } linux-40cm

Re: proposed BASH_SOURCE_PATH

2024-07-11 Thread konsolebox
On Thu, Jul 11, 2024 at 4:08 AM Chet Ramey wrote: > and the BASH_SOURCE > absolute pathname discussion has been bananas, so that's not going in any > time soon. Maybe just create BASH_SOURCE_REAL instead to avoid the gripes. https://gist.github.com/konsolebox/d9fb2fadd2b8b13d96d0aa7ebea836d9#fil