Nicer error message for zsh versions before 5.1

This commit is contained in:
Kovid Goyal 2022-07-08 20:28:42 +05:30
parent d6492264c7
commit 31dfee8a95
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -27,6 +27,11 @@ fi
[[ ! -r "$_ksi_file" ]] || 'builtin' 'source' '--' "$_ksi_file"
} always {
if [[ -o 'interactive' && -n "${KITTY_SHELL_INTEGRATION-}" ]]; then
'builtin' 'autoload' '--' 'is-at-least'
'is-at-least' "5.1" || {
builtin echo "ZSH ${ZSH_VERSION} is too old for kitty shell integration" > /dev/stderr
return
}
# ${(%):-%x} is the path to the current file.
# On top of it we add :A:h to get the directory.
'builtin' 'typeset' _ksi_file="${${(%):-%x}:A:h}"/kitty-integration