Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executable in cwd highlighted when cwd isn't in $PATH #894

Open
danielshahaf opened this issue Aug 28, 2022 · 2 comments
Open

Executable in cwd highlighted when cwd isn't in $PATH #894

danielshahaf opened this issue Aug 28, 2022 · 2 comments

Comments

@danielshahaf
Copy link
Member

danielshahaf commented Aug 28, 2022

After the following:

$ zsh -f
% . ./zsh-syntax-highlighting.zsh
% () { touch $1 && chmod +x $1 && print -zr -- $1} "$(pwgen -an 16 1 | tee /dev/tty)"
[run that, then type a space to refresh highlighting]

the command word is highlighted in green, even though running it fails with zsh: command not found.

@danielshahaf
Copy link
Member Author

if (( in_command_position )); then
# ### Currently, this value is never returned: either it's overwritten
# ### below, or the return code is non-zero
REPLY=arg0
else
REPLY=path
fi

That arg0 is returned, just like the comment says can't happen.

@danielshahaf
Copy link
Member Author

As is this one:

elif [[ ! -d $expanded_path ]]; then
# ### This seems unreachable for the current callers
return 0

I guess the surrounding chain of if/else's needs to account for the possibility that $expanded_path is an executable non-directory without slashes and $path doesn't include cwd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant