__fish_list_current_token: Do not use eval

Similarly to b0e3cc4b5 (__fish_complete_suffix: Remove `eval`,
2019-12-28), this use of eval is unsafe and can spew errors if
invoked on an incomplete brace expansion.
This commit is contained in:
Wolfgang Müller 2021-06-22 15:46:37 +02:00 committed by Fabian Homborg
parent ece88ca2d2
commit 4a3df618f2

View File

@ -2,7 +2,7 @@
# of the directory under the cursor.
function __fish_list_current_token -d "List contents of token under the cursor if it is a directory, otherwise list the contents of the current directory"
set -l val (eval echo (commandline -t))
set -l val (commandline -t)
printf "\n"
if test -d $val
ls $val