[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
eval constructs in prog. completion funcs dont't work
From: |
Markus Schwarzenberg |
Subject: |
eval constructs in prog. completion funcs dont't work |
Date: |
Thu, 19 Apr 2001 16:52:54 +0200 (MET DST) |
Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.7
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc'
-DCONF_OSTYPE='solaris2.7' -DCONF_MACHTYPE='sparc-sun-solaris2.7'
-DCONF_VENDOR='sun' -DSHELL -DHAVE_CONFIG_H -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I. -I. -I./include -I./lib
-I/home/digital/schwarzenberg/sol57/include -O2
uname output: SunOS sund32 5.7 Generic_106541-07 sun4u sparc SUNW,Ultra-5_10
Machine Type: sparc-sun-solaris2.7
Bash Version: 2.05
Patch Level: 0
Release Status: release
Description:
When there is an eval-construct in a function which is
called for programmable completion (complete -F ...)
bash gets into some unexpected state on the first
completion attempt which uses this function.
Repeat-By:
1. Define the following function:
test_func () { eval COMPREPLY=( A B ) ; }
2. use it as completion function:
complete -F test_func xx
3. make an attempt to complete the following:
xx <space> <tab> <tab>
-> A B appears correctly as completion choices.
<enter>
-> New lnput line appears - Nothing else happenes!
xx is not executed!!
bash remains in this state until a CTRL-C or
CTRL-D (response: bash-2.05: syntax error: unexpected end of file)
is enterd.
Remarks:
- bash2.04 behaves correctly for that example
- the example isn't usefull, but demostrates what happenes.
- the malfunction doesn't depend on which variable
is set in the eval-construct (it doesn't work with
variables different from COMPREPLY, too).
- I need the eval-construct to embed filenames containing
spaces in the COMPREPLY array:
eval COMPREPLY=( $(compgen -P'"' -S'"' -f -X "$excl_pat"
${COMP_WORDS[COMP_CWORD] ) )
Fix:
No idea ;-(
- eval constructs in prog. completion funcs dont't work,
Markus Schwarzenberg <=