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

Inner command words highlighting disregards allowed types #608

Open
3 tasks
danielshahaf opened this issue Mar 29, 2019 · 3 comments
Open
3 tasks

Inner command words highlighting disregards allowed types #608

danielshahaf opened this issue Mar 29, 2019 · 3 comments

Comments

@danielshahaf
Copy link
Member

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.
danielshahaf added a commit to danielshahaf/zsh-syntax-highlighting that referenced this issue Mar 29, 2019
@danielshahaf
Copy link
Member Author

(GitHub's UI doesn't show that I pushed the tests to this repository as well: bc3f77f)

@danielshahaf
Copy link
Member Author

Cross-referencing #249 #541 #545, which are all variants of this.

@danielshahaf
Copy link
Member Author

Also #461.

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