zsh: improve minimum version check (#9772)

- Handle autoload failures
- Prefer ">&2" to "/dev/stderr" for portability
- Quote commands for consistency and to avoid alias conflicts
pull/9777/head
Jon Parise 2025-12-01 11:15:02 -05:00 committed by GitHub
commit 5714ed07a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 3 deletions

View File

@ -43,9 +43,8 @@ fi
[[ ! -r "$_ghostty_file" ]] || 'builtin' 'source' '--' "$_ghostty_file"
} always {
if [[ -o 'interactive' ]]; then
'builtin' 'autoload' '--' 'is-at-least'
'is-at-least' "5.1" || {
builtin echo "ZSH ${ZSH_VERSION} is too old for ghostty shell integration" > /dev/stderr
'builtin' 'autoload' '--' 'is-at-least' 2>/dev/null && 'is-at-least' "5.1" || {
'builtin' 'echo' "zsh ${ZSH_VERSION} is too old for ghostty shell integration" >&2
'builtin' 'unset' '_ghostty_file'
return
}