shopt compat

2024-08-13 Thread Martin Kealey
Hi Chet I have worked up a patch that considerably simplifies the logic for setting and displaying the shopt compatXX settings, by getting rid of the numberous boolean variables and simply computing the setting level directly. However before I submit my compatXX patch, I would like to ensure I've

Another redisplay issue in single-byte locales

2024-08-13 Thread Grisha Levit
In a single-byte locale, if the prompt is wider than the screen width and contains invisible characters on the last line, and the input line is also wider than the screen width, redisplay gets messed up: printf -v s '%*s' "$COLUMNS" PS1=$s'%\[\e[0m\]' LC_ALL=C bash --norc -in <<< $s$'X\caY

Re: Question on $@ vs $@$@

2024-08-13 Thread Greg Wooledge
On Wed, Aug 14, 2024 at 02:45:25 +0200, Steffen Nurpmeso wrote: > I include bug-bash even though i think bash is correct, but there > lots of people of expertise are listening, so, thus. > Sorry for cross-posting, nonetheless. > Given this snippet (twox() without argument it is) > > one() { echo

Re: Question on $@ vs $@$@

2024-08-13 Thread alex xmb sw ratchev
On Wed, Aug 14, 2024, 02:45 Steffen Nurpmeso wrote: > Hello. > > I include bug-bash even though i think bash is correct, but there > lots of people of expertise are listening, so, thus. > Sorry for cross-posting, nonetheless. > Given this snippet (twox() without argument it is) > > one() { echo

Question on $@ vs $@$@

2024-08-13 Thread Steffen Nurpmeso
Hello. I include bug-bash even though i think bash is correct, but there lots of people of expertise are listening, so, thus. Sorry for cross-posting, nonetheless. Given this snippet (twox() without argument it is) one() { echo "$# 1<$1>"; } two() { one "$@"; } twox() { one "$@$@"; } two

Re: printf inconsistent results for %.0f

2024-08-13 Thread Grisha Levit
On Mon, Aug 12, 2024, 11:04 Chet Ramey wrote: > My question is why the (admittedly old) gnulib replacement strtod/strtold > is messing things up. > Looks like printf(3) gets called with a `Lf' conversation specifier and a double argument. diff --git a/builtins/printf.def b/builtins/printf.def i

Re: word selection in history expansion - !?word?%

2024-08-13 Thread Chet Ramey
On 8/12/24 5:15 PM, Jess M wrote: Given the age of the behaviour, I would agree on not making it the default behaviour. To update the documentation to reflect that, how about something like this: --- current --- lib/readline/doc/hsuser.texi  @item %  The first word matched by the most recent

[PATCH] read: unsigned char delim issues

2024-08-13 Thread Grisha Levit
The new read_mbchar code is missing an (unsigned char) cast, causing an invalid continuation byte >0x7F to fail to be recognized as a delimiter on platforms where char is signed. $ printf '\317_' | { read -d _; echo "${REPLY@Q}"; } $'\317' $ printf '\317\360_' | { read -d $'\360'; echo

Re: termios.h not included if sys/ioctl.h provides struct winsize

2024-08-13 Thread Chet Ramey
On 8/12/24 10:18 PM, Grisha Levit wrote: On e.g. Alpine Linux, the following are set by configure: bash_cv_struct_winsize_ioctl='yes' bash_cv_struct_winsize_termios='yes' bash_cv_struct_winsize_header='ioctl_h' ac_cv_func_tcgetwinsize='yes' and so config.h ends up with:

Re: Incorrect positioning when long prompt contains ANSI escape sequences + UTF-8 LANG

2024-08-13 Thread Chet Ramey
On 8/8/24 3:40 PM, Gioele Barabucci wrote: Hi, bash 5.2.21 produces severely wrong artifacts under the following conditions: * the length of the prompt matches $COLUMN*2 + 1; * the prompt contains ANSI escape sequences; * the LANG variable is set to an installed UTF-8 locale. When all these co