From 54a85d6c6744df54af2c092234ba84baacdc5ebc Mon Sep 17 00:00:00 2001 From: sev Date: Sun, 23 Jul 2023 13:11:20 -0500 Subject: [PATCH] small fixes zsh - detect Termux env and skip pointless zprofile early load - don't show error on gpg setup if gpg-agent.conf doesnt exist - remove temp var from env --- base/.zshenv | 2 +- etc/zsh/.zprofile | 3 ++- etc/zsh/.zshrc | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/base/.zshenv b/base/.zshenv index 90ec4ca..f6f0646 100644 --- a/base/.zshenv +++ b/base/.zshenv @@ -25,7 +25,7 @@ if [[ ! -v _sev_first_display && ( -v DISPLAY || -v WAYLAND_DISPLAY ) ]] { # display manager or launcher in front of it export _sev_first_display= _sev_refresh_gpgagent= source ${ZDOTDIR:-~}/.zprofile -} elif [[ ! -o login && $SHLVL == 1 ]] { +} elif [[ ! -o login && $SHLVL -eq 1 && ${+TERMUX_VERSION} -eq 0 ]] { ### early zprofile sourcing for first shell even if not a login shell source ${ZDOTDIR:-~}/.zprofile } diff --git a/etc/zsh/.zprofile b/etc/zsh/.zprofile index 3bad054..9b93f41 100644 --- a/etc/zsh/.zprofile +++ b/etc/zsh/.zprofile @@ -346,8 +346,9 @@ if [[ -v commands[gpg-connect-agent] && ${+DISPLAY} + ${+WAYLAND_DISPLAY} == 0)) # XXX: don't know if gpg-agent supports comments after directives # XXX: path could have # + # XXX: we are assuming this is our pinentry from .local/bin sed -Ei 's#^([[:space:]]*pinentry-program[[:space:]]).*$#\1'${commands[pinentry]:-/dev/null}'#' \ - ${GNUPGHOME:-~/.gnupg}/gpg-agent.conf + ${GNUPGHOME:-~/.gnupg}/gpg-agent.conf 2>/dev/null # XXX: could check for changes before doing this to save perf gpg-connect-agent RELOADAGENT UPDATESTARTUPTTY /bye >/dev/null 2>&1 if {$p} { diff --git a/etc/zsh/.zshrc b/etc/zsh/.zshrc index dd7d2dd..5b9c79a 100644 --- a/etc/zsh/.zshrc +++ b/etc/zsh/.zshrc @@ -308,6 +308,7 @@ autoload -Uz compinit cache=${XDG_CACHE_HOME:-~/.cache}/zsh [[ -d $cache ]] || mkdir -p $cache compinit -d $cache/.zcompdump +unset cache ### prompt autoload -Uz promptinit && promptinit -- 2.47.0