From 8b06929bc29d71567f95e537904cd071772e8863 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 11 Apr 2026 14:32:49 +0300 Subject: [PATCH] =?UTF-8?q?=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B3(zsh):=20=D1=83=D0=BB=D1=83=D1=87=D1=88?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20=D1=81=D1=82=D0=B0=D0=B1=D0=B8=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20Zsh=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Добавлены проверки минимальной версии Zsh для повышения надежности * Оптимизирована логика загрузки Powerlevel10k * Внедрена быстрая проверка Starship --- 05-start.zsh | 4 ++++ 88-prompt.zsh | 29 +++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/05-start.zsh b/05-start.zsh index a972243..908d42f 100644 --- a/05-start.zsh +++ b/05-start.zsh @@ -6,6 +6,10 @@ # Initialization code that may require console input # (password prompts, [y/n] confirmations, etc.) # must go above this block; everything else may go below. + +! is-at-least 5.8 && return +command -v starship >/dev/null && return + if [ -r "${XDG_CACHE_HOME}/p10k-instant-prompt-${(%):-%n}.zsh" ]; then source "${XDG_CACHE_HOME}/p10k-instant-prompt-${(%):-%n}.zsh" fi diff --git a/88-prompt.zsh b/88-prompt.zsh index 242a801..341be17 100644 --- a/88-prompt.zsh +++ b/88-prompt.zsh @@ -1,25 +1,26 @@ # shellcheck shell=bash # vim: ft=sh +if ! is-at-least 5.8; then + zinit light agkozak/agkozak-zsh-prompt + return +fi + if command -v starship >/dev/null; then eval "$(starship init zsh)" return fi -if is-at-least 5.3; then - zinit ice depth"1" # git clone depth - zinit light romkatv/powerlevel10k +zinit ice depth"1" # git clone depth +zinit light romkatv/powerlevel10k - # To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh. - if [[ -r "$ZDOTDIR/.p10k.user.zsh" ]]; then - source "$ZDOTDIR/.p10k.user.zsh" - else - if [[ "$TERM" = "xterm" ]]; then - [[ -r "$ZDOTDIR/.p10k.8colors.zsh" ]] && source "$ZDOTDIR/.p10k.8colors.zsh" - else - [[ -r "$ZDOTDIR/.p10k.zsh" ]] && source "$ZDOTDIR/.p10k.zsh" - fi - fi +# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh. +if [[ -r "$ZDOTDIR/.p10k.user.zsh" ]]; then + source "$ZDOTDIR/.p10k.user.zsh" else - zinit light agkozak/agkozak-zsh-prompt + if [[ "$TERM" = "xterm" ]]; then + [[ -r "$ZDOTDIR/.p10k.8colors.zsh" ]] && source "$ZDOTDIR/.p10k.8colors.zsh" + else + [[ -r "$ZDOTDIR/.p10k.zsh" ]] && source "$ZDOTDIR/.p10k.zsh" + fi fi