Fix zle-line-init error when connecting via SSH
Guard zle -N widget registration behind function existence checks, since oh-my-zsh plugins that define these functions may not be loaded yet depending on shell init order (e.g. over SSH). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -125,9 +125,9 @@ autoload -Uz add-zsh-hook
|
||||
add-zsh-hook preexec adlee_preexec
|
||||
add-zsh-hook precmd adlee_precmd
|
||||
|
||||
# Configure ZLE
|
||||
zle -N zle-line-init
|
||||
zle -N zle-keymap-select
|
||||
# Configure ZLE (only register widgets if the functions exist, e.g. from vi-mode plugin)
|
||||
(( ${+functions[zle-line-init]} )) && zle -N zle-line-init
|
||||
(( ${+functions[zle-keymap-select]} )) && zle -N zle-keymap-select
|
||||
|
||||
# Initial prompt build (critical for tmux)
|
||||
_adlee_build_prompt
|
||||
|
||||
Reference in New Issue
Block a user