Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

completion considers equals sign (=) its own word?

1 view
Skip to first unread message

beba...@gmail.com

unread,
Dec 15, 2009, 6:01:53 AM12/15/09
to bug-...@gnu.org, ba...@packages.debian.org
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I../bash -I../bash/include -I../bash/lib -g -O2 -Wall
uname output: Linux swboyd-laptop 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:01:29 UTC 2009 i686 GNU/Linux
Machine Type: i486-pc-linux-gnu

Bash Version: 4.0
Patch Level: 33
Release Status: release

Description:
When completing options for git I used to be able to get a list
of pretty formats by completing the --pretty= option. The option
ends in an equals sign, so the completion looks for the word
--pretty= in the COMP_WORDS array. It turns out that --pretty and =
are considered two separate words in bash4, but considered one word
in bash3. Is this intended?

I know I'm reporting this on patch level 33, but I've seen it on
patch level 35 too.

Repeat-By:
1) Install git's completion script (in contrib/completion of
http://kernel.org/pub/software/scm/git/git-1.6.5.6.tar.gz)
2) Try to complete
git show --pretty=<TAB><TAB>

and you get a list of filenames instead of a list of pretty formats.


Chet Ramey

unread,
Dec 17, 2009, 10:03:23 AM12/17/09
to beba...@gmail.com, bug-...@gnu.org, ba...@packages.debian.org, chet....@case.edu
On 12/15/09 6:01 AM, beba...@gmail.com wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: i486
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I../bash -I../bash/include -I../bash/lib -g -O2 -Wall
> uname output: Linux swboyd-laptop 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:01:29 UTC 2009 i686 GNU/Linux
> Machine Type: i486-pc-linux-gnu
>
> Bash Version: 4.0
> Patch Level: 33
> Release Status: release
>
> Description:
> When completing options for git I used to be able to get a list
> of pretty formats by completing the --pretty= option. The option
> ends in an equals sign, so the completion looks for the word
> --pretty= in the COMP_WORDS array. It turns out that --pretty and =
> are considered two separate words in bash4, but considered one word
> in bash3. Is this intended?

Yes. The programmable completion in bash-4.x uses the same set of
characters to split words as the readline word completion code. Doing
otherwise led to too many weird inconsistencies.

If you want to remove `=' from the set of `completion word break'
characters, you can modify the COMP_WORDBREAKS variable.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU ch...@case.edu http://cnswww.cns.cwru.edu/~chet/


0 new messages