Should the readline *-meta flags reset when $LANG changes?

2022-08-08 Thread Alan Coopersmith
One of our users complained that bash-5.1 on Solaris 11.4, when started with LANG=C does not allow Unicode input after changing LANG to a UTF-8 locale until bash is restarted. I've confirmed this is the default behavior, but can be overridden by manually changing the readline output-meta flag fro

Re: return exit code in EXIT trap

2022-08-08 Thread Robert E. Griffith
On 8/8/22 16:38, Robert Elz wrote: There's no need for anything to make that work, when the trap action starts running $? is set to whatever it was just previously, and the code there can save and/or use that value however it sees the need. Well I'll be. I had to write a script to test it becaus

Re: return exit code in EXIT trap

2022-08-08 Thread Chet Ramey
On 8/8/22 4:22 PM, Robert Elz wrote: Date:Mon, 8 Aug 2022 14:45:06 -0400 From:Chet Ramey Message-ID: <253ddd1c-2d2d-1ac1-f4bb-a611896ce...@case.edu> | > Having "exit" mean "exit $?-as-it-was" | > in those circumstances makes some sense, having return do

Re: return exit code in EXIT trap

2022-08-08 Thread Robert Elz
Date:Mon, 8 Aug 2022 15:16:41 -0400 From:"Robert E. Griffith" Message-ID: <887ca26e-1c9e-f500-1bd9-6d339ab5a...@junga.com> | I think a better solution to that would have been to leave return alone | and instead allow the trap to access the $? value of the last co

Re: return exit code in EXIT trap

2022-08-08 Thread Robert Elz
Date:Mon, 8 Aug 2022 14:45:06 -0400 From:Chet Ramey Message-ID: <253ddd1c-2d2d-1ac1-f4bb-a611896ce...@case.edu> | > Having "exit" mean "exit $?-as-it-was" | > in those circumstances makes some sense, having return do that is absurd. | | You are going to hav

Re: return exit code in EXIT trap

2022-08-08 Thread Robert E. Griffith
Understanding now that traps are more literally like inserting an eval, what makes return in the top level trap string special is that there are two script paths behind it so its reasonable the the coder of the trap to ask from which last statement do I want to preserve the exit code. The shell

Re: return exit code in EXIT trap

2022-08-08 Thread Chet Ramey
On 8/8/22 1:53 PM, Robert Elz wrote: Date:Mon, 8 Aug 2022 10:34:50 -0400 From:Chet Ramey Message-ID: <6ea53781-b6a8-8be1-2314-a25904727...@case.edu> | It's a logical conclusion from the requirement that the trap action be | executed as if you had dropped an

Re: return exit code in EXIT trap

2022-08-08 Thread Robert Elz
Date:Mon, 8 Aug 2022 10:34:50 -0400 From:Chet Ramey Message-ID: <6ea53781-b6a8-8be1-2314-a25904727...@case.edu> | It's a logical conclusion from the requirement that the trap action be | executed as if you had dropped an `eval action' into the function, or | whe

Re: return exit code in EXIT trap

2022-08-08 Thread Chet Ramey
On 8/6/22 12:05 AM, Robert Elz wrote: I am actually astounded by all of this - both by what is in the standard, and the way Chet interpreted it. The language in the standard for return was clearly based upon the idea that it should act just the same as exit, which is not really appropriate. It

Re: return exit code in EXIT trap

2022-08-08 Thread Chet Ramey
On 8/6/22 2:44 PM, Robert Elz wrote: It is possible (and seems so, from messages in this thread) that bash allows a return in the trap string (not in a function called in that string) if the trap occurs while executing a function (then the return applies to that function). Every shell allows t