Skip to content

Inner command words highlighting disregards allowed types #608

Open
@danielshahaf

Description

@danielshahaf

In the commands builtin foo, command foo, and sudo foo, the inner command word foo 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 after command 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.

  • Add test cases of the form builtin foo.
  • Add test cases of the (somewhat misleading) form builtin command foo.
  • Add test cases with precommands that are external commands.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions