Reviewing #66 , I noticed $thefiles leaks into the shellex command
line. It does not make it to the child process (cat $thefiles > /tmp/test yields and empty file) but echo $thefi⇥ completes the
variable name and echo ${f}⇥ substitutes it. Declaring them local
(local -a thefiles) is not an ad-hoc solution as they get solved. Atm
unset thefiles at the end of shellexrc seems good to me, but not to
interfere with possible user variables, I would prefer namespacing the
shell variables in addition. Following typical completion functions,
that would involve leading underscores in the variable name, and
probably even shellex in the name.
I thought a bit if not-unsetting them and make them accessible to the
user (for whatever they would want to do with them … debugging?) but
since the behaviour is inconsistent (accessible to tabbing,
inaccessible to processes), I assume it's not worth it.
Reviewing #66 , I noticed
$thefilesleaks into the shellex commandline. It does not make it to the child process (
cat $thefiles > /tmp/testyields and empty file) butecho $thefi⇥completes thevariable name and
echo ${f}⇥substitutes it. Declaring them local(
local -a thefiles) is not an ad-hoc solution as they get solved. Atmunset thefilesat the end ofshellexrcseems good to me, but not tointerfere with possible user variables, I would prefer namespacing the
shell variables in addition. Following typical completion functions,
that would involve leading underscores in the variable name, and
probably even
shellexin the name.I thought a bit if not-unsetting them and make them accessible to the
user (for whatever they would want to do with them … debugging?) but
since the behaviour is inconsistent (accessible to tabbing,
inaccessible to processes), I assume it's not worth it.