Skip to content

Conversation

@Atyansh
Copy link

@Atyansh Atyansh commented Nov 23, 2025

Problem

When using this plugin alongside zsh-users/zsh-syntax-highlighting, pressing backspace or enter on an empty command line produces errors like:

  • _zsh_highlight-zle-buffer-p:4: permission denied:
  • _zsh_highlight-zle-buffer:25: permission denied:
  • _zsh_highlight-zle-buffer:27: not an identifier:

This happens because both plugins share internal arrays (zsh_highlight_functions, zsh_highlight_predicates, zsh_highlight_caches) and the newer zsh-users plugin registers entries that are incompatible with this plugin's expectations.

Fix

  • Validate that $highlight_predicate is non-empty before executing it
  • Validate that $func exists as a callable function before invoking it
  • Validate that $cache_place is a valid identifier before using it in parameter assignment

Builds on #12 with additional guards for the other affected code paths.

Testing

Tested with both plugins loaded via antigen on zsh 5.9. Backspace and enter on empty command line no longer produce errors.

When using this plugin alongside zsh-users/zsh-syntax-highlighting,
pressing backspace or enter on an empty command line produces errors:
- _zsh_highlight-zle-buffer-p:4: permission denied:
- _zsh_highlight-zle-buffer:25: permission denied:
- _zsh_highlight-zle-buffer:27: not an identifier:

This happens because both plugins share internal arrays and the newer
zsh-users plugin registers entries that are incompatible.

Fix:
- Validate highlight_predicate is non-empty before executing
- Validate func exists as callable function before invoking
- Validate cache_place is a valid identifier before assignment

Builds on trapd00r#12 with additional guards.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Atyansh Atyansh force-pushed the fix-permission-errors branch from 9caf70b to f1c1715 Compare November 23, 2025 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant