zsh-users/zsh-syntax-highlighting

PATH_DIRS shouldn't be honoured after `sudo`

Open

#595 aberto em 24 de dez. de 2018

Ver no GitHub
 (0 comments) (0 reactions) (0 assignees)Shell (1.371 forks)batch import
Buggood first issuesyntax:command-word

Métricas do repositório

Stars
 (22.617 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

The main highlighter explicitly sets PATH_DIRS if the user has that enabled:

https://github.com/zsh-users/zsh-syntax-highlighting/blob/55f846c673661bde03ef97333be7889f54079c7b/highlighters/main/main-highlighter.zsh#L316-L318

This is so, if $^path/foo/bar(*N) exists, % foo/bar will be highlighted in green. However, that also happens in sudo foo/bar, even though sudo doesn't do path searches when there's a / in the argument — at least, I think that's how sudo behaves, but double-check that before making any code change on our end.

Guia do colaborador