The fix adds a function that expands variables without evaluating the passed string in the __fasd_run function.
This allows constructs such as redirections, loops, glob expansions, etc... to not be affected by the fish_postexec hook.
This lets fasd take account of relative directories.
The following is an example of save variable expansion when a for loop is passed:
$ set folders foo bar baz
$ __fasd_expand_vars 'for f in $folders; echo \$folders; cd $f; cd $abc; echo $folders; end'
for
f
in
foo
bar
baz
echo
\$folders
cd
f
cd
abc
echo
folders
end
Variables are also expanded correctly if the input is multi-line:
$ set folders foo bar baz
$ __fasd_expand_vars 'for f in $folders
echo \$folders
cd $f
cd $abc
echo $folders
end'
for
f
in
foo
bar
baz
echo
\$folders
cd
f
cd
abc
echo
folders
end
This PR fixes issues #16, #17, and #18.
The fix adds a function that expands variables without evaluating the passed string in the
__fasd_run
function.This allows constructs such as redirections, loops, glob expansions, etc... to not be affected by the fish_postexec hook. This lets fasd take account of relative directories.
The following is an example of save variable expansion when a for loop is passed:
Variables are also expanded correctly if the input is multi-line: