From 31dfee8a95895601a8e06dc2c0d5fd967b0fd36a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 8 Jul 2022 20:28:42 +0530 Subject: [PATCH] Nicer error message for zsh versions before 5.1 --- shell-integration/zsh/.zshenv | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell-integration/zsh/.zshenv b/shell-integration/zsh/.zshenv index 7a087f8ae..e75538c0a 100644 --- a/shell-integration/zsh/.zshenv +++ b/shell-integration/zsh/.zshenv @@ -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