if ! is-at-least 5.4; then
  zshexit() {
    # The zsh builtin `kill` fails sometimes in older versions
    # https://unix.stackexchange.com/a/477647/156673
    kill -KILL $$ 2>&- || command kill -KILL $$

    # Block for long enough for the signal to come through
    sleep 1
  }
fi
