Open danielshahaf opened 5 years ago
(GitHub's UI doesn't show that I pushed the tests to this repository as well: https://github.com/zsh-users/zsh-syntax-highlighting/commit/bc3f77f719ae80b5258292a10a5461aee5597eb2)
Cross-referencing #249 #541 #545, which are all variants of this.
Also #461.
In the commands
builtin foo
,command foo
, andsudo foo
, the inner command wordfoo
should be looked up only as a builtin or external command, respectively.After
builtin
aliases, function names, hashed command names, and absolute paths should be red even if they're otherwise valid; similar restrictions apply aftercommand
and external commands that are precommands (e.g.,sudo
/doas
,env
,ssh
,xargs
,chroot
/jexec
,strace
,setsid
,stdbuf
, etc). We needn't enumerate them; any known precommand [see$precommand_options
] that's itself an external command — that is, isn't shadowed by a function or alias — can only be followed by external commands.This should be fairly easy to fix by making the setting and testing of the
:start:
state more fine-grained.builtin foo
.builtin command foo
.