Debian Bug report logs -
#622383
bash-completion: completion only works from left to right: error : bash: $index: substring expression < 0
Reported by: Alban Browaeys <prahal@yahoo.com>
Date: Tue, 12 Apr 2011 17:00:02 UTC
Severity: wishlist
Tags: confirmed, fixed-upstream, upstream
Merged with 624703
Found in versions 1.2-3, bash-completion/1:1.3-2
Fixed in version bash-completion/1:1.90-1
Done: David Paleino <dapal@debian.org>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded
to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#622383; Package bash-completion.
(Tue, 12 Apr 2011 17:00:04 GMT) (full text, mbox, link).
Acknowledgement sent
to Alban Browaeys <prahal@yahoo.com>:
New Bug report received and forwarded. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.
(Tue, 12 Apr 2011 17:00:04 GMT) (full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: bash-completion
Version: 1:1.3-2
Severity: wishlist
Typing :
$ ls a
then moving the cursor between 'ls' and 'a' and pressing <Tab> leads to:
bash: $index: substring expression < 0
Thus completion only works right to the last character in a command. Is a fix
at reach ? Or is it by design ?
I could spend some time on this issue though I have not looked into it since bash 3.0 so
I bet most of what I know is obsolete. A clue would be welcomed.
Best regards,
Alban
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.38-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages bash-completion depends on:
ii bash 4.1-3 The GNU Bourne Again SHell
bash-completion recommends no packages.
bash-completion suggests no packages.
-- no debconf information
Information forwarded
to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#622383; Package bash-completion.
(Tue, 12 Apr 2011 17:18:12 GMT) (full text, mbox, link).
Acknowledgement sent
to dapal@debian.org:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.
(Tue, 12 Apr 2011 17:18:12 GMT) (full text, mbox, link).
Message #10 received at 622383@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
tags 622383 unreproducible moreinfo
thanks
Hello,
On Tue, 12 Apr 2011 18:56:58 +0200, Alban Browaeys wrote:
> Typing :
> $ ls a
> then moving the cursor between 'ls' and 'a' and pressing <Tab> leads to:
> bash: $index: substring expression < 0
>
> Thus completion only works right to the last character in a command. Is a fix
> at reach ? Or is it by design ?
I can't reproduce this (| is where I place the cursor, and hit TAB):
$ ls a|
acpi-path-to-use-sysfs.mdwn am-assigned.mdwn
[..]
$ ls |a
Display all 110 possibilities? (y or n)
^C
$
Can you please "set -x", and paste/attach the output to the bugreport?
Thank you,
David
--
. ''`. Debian developer | http://wiki.debian.org/DavidPaleino
: :' : Linuxer #334216 --|-- http://www.hanskalabs.net/
`. `'` GPG: 1392B174 ----|---- http://deb.li/dapal
`- 2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
[signature.asc (application/pgp-signature, attachment)]
Added tag(s) unreproducible and moreinfo.
Request was from David Paleino <dapal@debian.org>
to control@bugs.debian.org.
(Tue, 12 Apr 2011 17:18:14 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#622383; Package bash-completion.
(Tue, 12 Apr 2011 17:45:06 GMT) (full text, mbox, link).
Acknowledgement sent
to Alban Browaeys <prahal@yahoo.com>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.
(Tue, 12 Apr 2011 17:45:06 GMT) (full text, mbox, link).
Message #17 received at 622383@bugs.debian.org (full text, mbox, reply):
Le mardi 12 avril 2011 à 19:16 +0200, David Paleino a écrit :
> tags 622383 unreproducible moreinfo
> thanks
>
> Hello,
>
> On Tue, 12 Apr 2011 18:56:58 +0200, Alban Browaeys wrote:
>
> > Typing :
> > $ ls a
> > then moving the cursor between 'ls' and 'a' and pressing <Tab> leads to:
> > bash: $index: substring expression < 0
> >
> > Thus completion only works right to the last character in a command. Is a fix
> > at reach ? Or is it by design ?
>
> I can't reproduce this (| is where I place the cursor, and hit TAB):
>
> $ ls a|
> acpi-path-to-use-sysfs.mdwn am-assigned.mdwn
> [..]
> $ ls |a
> Display all 110 possibilities? (y or n)
> ^C
> $
>
Sorry I forgot to tell there need to be a space before and after the
location where the cursor is:
$ ls <cursor> a
> Can you please "set -x", and paste/attach the output to the bugreport?
>
> Thank you,
> David
>
$ ls + local cur prev split=false
+ _get_comp_words_by_ref -n = cur prev
+ local exclude flag i OPTIND=1
+ words=()
+ local cur cword words
+ upargs=()
+ upvars=()
+ local upargs upvars vcur vcword vprev vwords
+ getopts c:i:n:p:w: flag -n = cur prev
+ case $flag in
+ exclude==
+ getopts c:i:n:p:w: flag -n = cur prev
+ [[ 4 -ge 3 ]]
+ case ${!OPTIND} in
+ vcur=cur
+ let 'OPTIND += 1'
+ [[ 4 -ge 4 ]]
+ case ${!OPTIND} in
+ vprev=prev
+ let 'OPTIND += 1'
+ [[ 4 -ge 5 ]]
+ __get_cword_at_cursor_by_ref = words cword cur
+ words=()
+ local cword words
+ __reassemble_comp_words_by_ref = words cword
+ local exclude i j ref
+ [[ -n = ]]
+ exclude==
+ eval cword=1
++ cword=1
+ [[ -n = ]]
+ (( i=0, j=0 ))
+ (( i < 2 ))
+ [[ 0 -gt 0 ]]
+ ref='words[0]'
+ eval 'words[0]=${!ref}${COMP_WORDS[i]}'
++ words[0]=ls
+ [[ 0 == 1 ]]
+ (( i++, j++ ))
+ (( i < 2 ))
+ [[ 1 -gt 0 ]]
+ [[ -n a ]]
+ [[ '' == a ]]
+ ref='words[1]'
+ eval 'words[1]=${!ref}${COMP_WORDS[i]}'
++ words[1]=a
+ [[ 1 == 1 ]]
+ eval cword=1
++ cword=1
+ (( i++, j++ ))
+ (( i < 2 ))
+ local i cur2
+ local 'cur=ls a'
+ local index=3
+ (( i = 0 ))
+ (( i <= cword ))
+ [[ 5 -ge 2 ]]
+ [[ ls != \l\s ]]
+ [[ 0 -lt 1 ]]
+ local old_size=5
+ cur=' a'
+ local new_size=3
+ index=1
+ (( ++i ))
+ (( i <= cword ))
+ [[ 3 -ge 1 ]]
+ [[ != \a ]]
+ cur=' a'
+ (( index-- ))
+ [[ 2 -ge 1 ]]
+ [[ != \a ]]
+ cur=a
+ (( index-- ))
+ [[ 1 -ge 1 ]]
+ [[ a != \a ]]
+ [[ 1 -lt 1 ]]
+ (( ++i ))
+ (( i <= cword ))
+ [[ a != \a ]]
bash: $index: substring expression < 0
Best regards,
Alban
Information forwarded
to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#622383; Package bash-completion.
(Tue, 12 Apr 2011 18:36:09 GMT) (full text, mbox, link).
Acknowledgement sent
to dapal@debian.org:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.
(Tue, 12 Apr 2011 18:36:10 GMT) (full text, mbox, link).
Message #22 received at 622383@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
tags 622383 = confirmed upstream
thanks
On Tue, 12 Apr 2011 19:43:02 +0200, Alban Browaeys wrote:
> Le mardi 12 avril 2011 à 19:16 +0200, David Paleino a écrit :
> > I can't reproduce this (| is where I place the cursor, and hit TAB):
> >
> > $ ls a|
> > acpi-path-to-use-sysfs.mdwn am-assigned.mdwn
> > [..]
> > $ ls |a
> > Display all 110 possibilities? (y or n)
> > ^C
> > $
>
> Sorry I forgot to tell there need to be a space before and after the
> location where the cursor is:
> $ ls <cursor> a
Ok, confirming it now, it also happens with the latest git revision.
> $ ls + local cur prev split=false
> + _get_comp_words_by_ref -n = cur prev
> + local exclude flag i OPTIND=1
> + words=()
> + local cur cword words
> + upargs=()
> + upvars=()
> + local upargs upvars vcur vcword vprev vwords
> + getopts c:i:n:p:w: flag -n = cur prev
> + case $flag in
> + exclude==
> + getopts c:i:n:p:w: flag -n = cur prev
> + [[ 4 -ge 3 ]]
> + case ${!OPTIND} in
> + vcur=cur
> + let 'OPTIND += 1'
> + [[ 4 -ge 4 ]]
> + case ${!OPTIND} in
> + vprev=prev
> + let 'OPTIND += 1'
> + [[ 4 -ge 5 ]]
> + __get_cword_at_cursor_by_ref = words cword cur
> + words=()
> + local cword words
> + __reassemble_comp_words_by_ref = words cword
> + local exclude i j ref
> + [[ -n = ]]
> + exclude==
> + eval cword=1
> ++ cword=1
> + [[ -n = ]]
> + (( i=0, j=0 ))
> + (( i < 2 ))
> + [[ 0 -gt 0 ]]
> + ref='words[0]'
> + eval 'words[0]=${!ref}${COMP_WORDS[i]}'
> ++ words[0]=ls
> + [[ 0 == 1 ]]
> + (( i++, j++ ))
> + (( i < 2 ))
> + [[ 1 -gt 0 ]]
> + [[ -n a ]]
> + [[ '' == a ]]
> + ref='words[1]'
> + eval 'words[1]=${!ref}${COMP_WORDS[i]}'
> ++ words[1]=a
> + [[ 1 == 1 ]]
> + eval cword=1
> ++ cword=1
> + (( i++, j++ ))
> + (( i < 2 ))
> + local i cur2
> + local 'cur=ls a'
> + local index=3
> + (( i = 0 ))
> + (( i <= cword ))
> + [[ 5 -ge 2 ]]
> + [[ ls != \l\s ]]
> + [[ 0 -lt 1 ]]
> + local old_size=5
> + cur=' a'
> + local new_size=3
> + index=1
> + (( ++i ))
> + (( i <= cword ))
> + [[ 3 -ge 1 ]]
> + [[ != \a ]]
> + cur=' a'
> + (( index-- ))
> + [[ 2 -ge 1 ]]
> + [[ != \a ]]
> + cur=a
> + (( index-- ))
> + [[ 1 -ge 1 ]]
> + [[ a != \a ]]
> + [[ 1 -lt 1 ]]
> + (( ++i ))
> + (( i <= cword ))
> + [[ a != \a ]]
> bash: $index: substring expression < 0
I'll investigate this, thanks.
Kindly,
David
--
. ''`. Debian developer | http://wiki.debian.org/DavidPaleino
: :' : Linuxer #334216 --|-- http://www.hanskalabs.net/
`. `'` GPG: 1392B174 ----|---- http://deb.li/dapal
`- 2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
[signature.asc (application/pgp-signature, attachment)]
Added tag(s) upstream and confirmed; removed tag(s) unreproducible and moreinfo.
Request was from David Paleino <dapal@debian.org>
to control@bugs.debian.org.
(Tue, 12 Apr 2011 18:36:11 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#622383; Package bash-completion.
(Tue, 12 Apr 2011 20:18:05 GMT) (full text, mbox, link).
Acknowledgement sent
to dapal@debian.org:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.
(Tue, 12 Apr 2011 20:18:05 GMT) (full text, mbox, link).
Message #29 received at 622383@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
tags 622383 fixed-upstream
thanks
Hello Alban,
On Tue, 12 Apr 2011 19:43:02 +0200, Alban Browaeys wrote:
> [..]
> bash: $index: substring expression < 0
I think I fixed it.
http://git.debian.org/?p=bash-completion/bash-completion.git;a=commitdiff;h=4ad538ba1a0ccb483899b4eaa70cc604d2b7bf78
Please wait for the next Debian package, or apply the patch yourself :)
Kindly,
David
--
. ''`. Debian developer | http://wiki.debian.org/DavidPaleino
: :' : Linuxer #334216 --|-- http://www.hanskalabs.net/
`. `'` GPG: 1392B174 ----|---- http://deb.li/dapal
`- 2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
[signature.asc (application/pgp-signature, attachment)]
Added tag(s) fixed-upstream.
Request was from David Paleino <dapal@debian.org>
to control@bugs.debian.org.
(Tue, 12 Apr 2011 20:18:06 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#622383; Package bash-completion.
(Tue, 12 Apr 2011 21:21:13 GMT) (full text, mbox, link).
Acknowledgement sent
to Alban Browaeys <prahal@yahoo.com>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.
(Tue, 12 Apr 2011 21:21:13 GMT) (full text, mbox, link).
Message #36 received at 622383@bugs.debian.org (full text, mbox, reply):
Le mardi 12 avril 2011 à 22:15 +0200, David Paleino a écrit :
> tags 622383 fixed-upstream
> thanks
>
> Hello Alban,
>
> On Tue, 12 Apr 2011 19:43:02 +0200, Alban Browaeys wrote:
>
> > [..]
> > bash: $index: substring expression < 0
>
> I think I fixed it.
>
> http://git.debian.org/?p=bash-completion/bash-completion.git;a=commitdiff;h=4ad538ba1a0ccb483899b4eaa70cc604d2b7bf78
>
Indeed it is gone ! (I am using the full bash-completion set from git)
No more in need to clean the command line to complete a forgotten token
in the middle.
Congratulations
Alban
Information forwarded
to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#622383; Package bash-completion.
(Sat, 30 Apr 2011 19:33:08 GMT) (full text, mbox, link).
Acknowledgement sent
to dapal@debian.org:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.
(Sat, 30 Apr 2011 19:33:08 GMT) (full text, mbox, link).
Message #41 received at 622383@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
forcemerge 622383 624703
thanks
Hello,
On Sat, 30 Apr 2011 11:50:26 -0700, Frank Harwald wrote:
> Package: bash-completion
> Version: 1.2-3
>
> There is a bug in bash-completion that makes it print out an error message
> when trying to complete any command by hitting <TAB> when bash_completion is
> loaded and the current command doesn't get any completion at all. It only
> works under special circumstances, e.g. the command line must have a special
> kind of format and the cursor must be at a specific position.
>
> It prints out the following error message:
> any_command bash: $index: substring expression < 0
> [..]
Seems like a duplicate of #622383. Would you please test the patch linked there?
Kindly,
David
--
. ''`. Debian developer | http://wiki.debian.org/DavidPaleino
: :' : Linuxer #334216 --|-- http://www.hanskalabs.net/
`. `'` GPG: 1392B174 ----|---- http://deb.li/dapal
`- 2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
[signature.asc (application/pgp-signature, attachment)]
Forcibly Merged 622383 624703.
Request was from David Paleino <dapal@debian.org>
to control@bugs.debian.org.
(Sat, 30 Apr 2011 19:33:13 GMT) (full text, mbox, link).
Added tag(s) pending.
Request was from David Paleino <dapal@debian.org>
to control@bugs.debian.org.
(Thu, 03 Nov 2011 12:06:07 GMT) (full text, mbox, link).
Reply sent
to David Paleino <dapal@debian.org>:
You have taken responsibility.
(Thu, 03 Nov 2011 12:25:46 GMT) (full text, mbox, link).
Notification sent
to Alban Browaeys <prahal@yahoo.com>:
Bug acknowledged by developer.
(Thu, 03 Nov 2011 12:25:55 GMT) (full text, mbox, link).
Message #50 received at 622383-close@bugs.debian.org (full text, mbox, reply):
Source: bash-completion
Source-Version: 1:1.90-1
We believe that the bug you reported is fixed in the latest version of
bash-completion, which is due to be installed in the Debian FTP archive:
bash-completion_1.90-1.debian.tar.gz
to main/b/bash-completion/bash-completion_1.90-1.debian.tar.gz
bash-completion_1.90-1.dsc
to main/b/bash-completion/bash-completion_1.90-1.dsc
bash-completion_1.90-1_all.deb
to main/b/bash-completion/bash-completion_1.90-1_all.deb
bash-completion_1.90.orig.tar.bz2
to main/b/bash-completion/bash-completion_1.90.orig.tar.bz2
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 622383@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
David Paleino <dapal@debian.org> (supplier of updated bash-completion package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Thu, 03 Nov 2011 13:03:51 +0100
Source: bash-completion
Binary: bash-completion
Architecture: source all
Version: 1:1.90-1
Distribution: experimental
Urgency: low
Maintainer: Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>
Changed-By: David Paleino <dapal@debian.org>
Description:
bash-completion - programmable completion for the bash shell
Closes: 577933 593835 604393 615134 618734 619014 622383 623680 625234 642526
Changes:
bash-completion (1:1.90-1) experimental; urgency=low
.
* bash-completion 2 preview: dynamic loading of completions
- optionally fallback to generic file completion if _filedir
returns nothing (Closes: #619014, LP: #533985)
- various fixes (Closes: #622383)
- apt: add 'download' to subcommands (Closes: #625234, LP: #720541)
- aptitude: add 'versions' command (Closes: #604393)
- dpkg-query: use the 'dpkg' completion (Closes: #642526)
- lintian: remove --unpack-level (Closes: #623680)
- rrdtool: complete filenames after commands (Closes: #577933)
- provide profile.d hook for per user disabling of bash_completion
(Closes: #593835)
- mutt: support tildes when recursively sourcing muttrc files
(Closes: #615134)
- tar: improve tar *[cr]*f completions (Closes: #618734)
* More checks in update-bash-completion: avoid unnecessary
sourcing of completion if symlink already exists
* Add message for users before they report a bug (debian/bug-presubj),
I'm kind of fed-up with bugs caused by acroread.sh :/
* Removed patches merged upstream
* Drop trigger-based completion loading
* Standards-Version bump to 3.9.2, no changes needed
Checksums-Sha1:
748b796aa5f70f17b2c3ec449dd7a8d66933bb8a 1394 bash-completion_1.90-1.dsc
aa1a1f4e34bff93f8227c1a200de310a04a21e86 228640 bash-completion_1.90.orig.tar.bz2
e5deb79d3aa91dff60baee0d4f1675fc5fd6ea2b 13057 bash-completion_1.90-1.debian.tar.gz
64a6a900971b2bc4d6d8706345f3037c81b85762 179058 bash-completion_1.90-1_all.deb
Checksums-Sha256:
78c827e512975c885b3cb09a2a50676d2f8bcd3c81b712a18035b288bfa0d92a 1394 bash-completion_1.90-1.dsc
293084b7584e89734002a49688ca9aea2bab16ca4750b30f66b62a373750c41c 228640 bash-completion_1.90.orig.tar.bz2
06975fe1a3291aadad7489d381183bcc64731f6b256647b8a5e277bb16ae97a8 13057 bash-completion_1.90-1.debian.tar.gz
4f78b12ab95b5ed24c8fe63e26d9f1635f189ccb9c7f7b503af101c0dfe92fe0 179058 bash-completion_1.90-1_all.deb
Files:
adf23b480b86c55d9e337258164785a0 1394 shells standard bash-completion_1.90-1.dsc
82635839d83074eba923822fd584490c 228640 shells standard bash-completion_1.90.orig.tar.bz2
ab9637c3c2aea423af97932b19bdc832 13057 shells standard bash-completion_1.90-1.debian.tar.gz
e43e91227a8d739a095577d51a1e0b78 179058 shells standard bash-completion_1.90-1_all.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEARECAAYFAk6yhD8ACgkQ5qqQFxOSsXQUSACfdui594rcT9CfiI3CyWfl60xa
UpMAoKbynog3IF+e2EOHcrFL6VBNbHPO
=Wi2f
-----END PGP SIGNATURE-----
Reply sent
to David Paleino <dapal@debian.org>:
You have taken responsibility.
(Thu, 03 Nov 2011 12:26:07 GMT) (full text, mbox, link).
Notification sent
to Frank Harwald <franki777@xmail.net>:
Bug acknowledged by developer.
(Thu, 03 Nov 2011 12:26:30 GMT) (full text, mbox, link).
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Fri, 02 Dec 2011 07:31:47 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Sun Jul 2 09:49:25 2023;
Machine Name:
bembo
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.