[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
apparent bug involving completion and eval
From: |
a050106 . 1 . keeLae3x |
Subject: |
apparent bug involving completion and eval |
Date: |
Thu, 6 Jan 2005 11:33:49 +0000 |
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/bash-3.0/share/locale'
-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -O2
uname output: Linux gilead 2.4.18-686 #1 Sun Apr 14 11:32:47 EST 2002 i686
unknown
Machine Type: i686-pc-linux-gnu
Bash Version: 3.0
Patch Level: 0
Release Status: release
Description:
In certain circumstances, attempting completion seems to cause
Bash to temporarily forget an alias. This seems
to occur when `eval' is used in the completion function.
Repeat-By:
To reproduce the problem, I first give the following 3 commands:
alias c5=echo
cf5() { eval true; }
complete -F cf5 c5
I then type "c5 a" at the command line. The cursor is now
just after the `a'. I then request completion by hitting
Tab (no completions are found, of course). I then hit Enter.
Bash then gives the message "-bash: c5: command not found".
If I redefine the function cf5 as follows:
cf5() { true; }
and then try the same thing, the problem doesn't occur. That is,
Bash finds the `c5' command and runs it.
By the way, the error message quoted above begins with "-bash",
not "bash" as in older versions of Bash. While I'm aware that
making argument 0 begin with a dash is the way to make Bash act
as a login shell, I don't see any reason for the dash to appear
in error messages. (Maybe I should log this as a separate bug,
but arguably it's not a bug, and it seems too trivial for a
separate bug report anyway.)
- apparent bug involving completion and eval,
a050106 . 1 . keeLae3x <=