internal command cd ; additional arguments are not ignored

2022-05-25 Thread martin i
Configuration Information [Automatically generated, do not change]:
Machine: amd64
OS: freebsd12.3
Compiler: cc
Compilation CFLAGS: -O2 -pipe -fno-omit-frame-pointer  -DLIBICONV_PLUG
-fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing
uname output: FreeBSD bxlr.sk 12.3-RELEASE FreeBSD 12.3-RELEASE
releng/12.3-n1-70cb68e7a BXLR  amd64
Machine Type: amd64-portbld-freebsd12.3

Bash Version: 5.1
Patch Level: 16
Release Status: release

Description:
Bash internal command cd doesn't ignore additional arguments
following dir as stated in its man page.
This is not OS dependent, reproducible on Linux/FreeBSD since
version 4.4.

Repeat-By:
$ cd /tmp /root
-bash: cd: too many arguments

While cd-ing to more dirs doesn't make sense this issue was
discovered by some bad regex in SAP profiles.
bash before 4.4 was silently ignoring this.

If this is expected behavior man page should be updated as those
arguments are not ignored any more.

martin


Re: UP does not invoke line history immediately

2022-05-25 Thread Chet Ramey

On 5/20/22 11:16 AM, Andrea Monaco wrote:


In rare cases, the following happens to me: when I press UP and then RET
to execute the last command line, and the two presses are close enough
in time, bash takes the UP key as input without invoking history, so it
tries to execute something like '^[[A'.


I can't reproduce this. The only thing I can think of is that the newline
gets added to the key sequence, so it doesn't match the arrow key.
Readline uses a timeout to determine whether input is to be considered
part of the current accumulating key sequence, but even when I press
newline much less than half a second (the default timeout) after the up
arrow, I don't get your results.

If you want to try to reproduce it reliably, the readline variable
"keyseq-timeout", specified in milliseconds, is what readline uses to
distinguish whether input should be added to the current key sequence.
You could try setting it to different values.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



Re: internal command cd ; additional arguments are not ignored

2022-05-25 Thread Chet Ramey

On 5/25/22 7:56 AM, martin i wrote:


Bash Version: 5.1
Patch Level: 16
Release Status: release

Description:
 Bash internal command cd doesn't ignore additional arguments
following dir as stated in its man page.
 This is not OS dependent, reproducible on Linux/FreeBSD since
version 4.4.


Thanks; that's a documentation error. It was fixed in bash-5.2-alpha.


--
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/