Commit 6dc990a
fix: check if compdef exists before registering zsh completion
Fix error "command not found: compdef" when sourcing wt shellenv
in zsh before compinit has been called.
The zsh completion system (compdef) is only available after compinit
has been initialized. Wrap the compdef call in a check to see if the
function exists before trying to use it.
This allows users to safely add 'source <(wt shellenv)' anywhere in
their ~/.zshrc without worrying about the order of initialization.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 7c024f3 commit 6dc990a
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
480 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
481 | 484 | | |
482 | 485 | | |
483 | 486 | | |
| |||
0 commit comments