Compare commits

...

9 Commits

Author SHA1 Message Date
Vonfry
4ae2f8a242
Merge 4c7ac6ff2e into 9626ce2beb 2024-12-12 08:11:14 +05:30
msdx321
9626ce2beb Add exception for VSCode env helper
Signed-off-by: msdx321 <msdx321@gmail.com>
2024-12-12 07:47:13 +05:30
Vonfry
4c7ac6ff2e
gpg module: the original grep expression cannot work on macos, make it simple for checking 2020-06-28 15:29:50 +08:00
Vonfry
2fc2920349
Merge branch 'master' into nixos-gpg-module-fix 2020-06-28 15:06:36 +08:00
Vonfry
7d32a08454
remove export after ln, because some tools will check the socket path
such as pam ssh auth on NixOS.
2019-01-26 14:59:21 +08:00
Vonfry
2e1b45c048
gpg modules: use gpgconf for other variable 2019-01-26 11:17:20 +08:00
Vonfry
a170d5b2b2
gpg module: grep conditon fix 2019-01-26 11:11:31 +08:00
Vonfry
5ebe88bfe0
gpg-module: unset socket variable 2019-01-26 11:02:42 +08:00
Vonfry
d66a0998d4
Fix gpg module condition
Fix gpg module grep regex expression, because of matching failed when `GPG_AGENT_INFO` is empty. 

And use gpgconf to get socket file instead of `$GNUPGHOME`.

fix: sorin-ionescu/prezto#1681
2019-01-26 11:00:37 +08:00
3 changed files with 7 additions and 6 deletions

View File

@ -11,16 +11,18 @@ if (( ! $+commands[gpg-agent] )); then
fi
# Set the default paths to gpg-agent files.
_gpg_agent_conf="${GNUPGHOME:-$HOME/.gnupg}/gpg-agent.conf"
_gpg_agent_conf="$(gpgconf --list-dir homedir)/gpg-agent.conf"
_gpg_agent_env="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/gpg-agent.env"
_gpg_agent_socket="$(gpgconf --list-dir agent-socket)"
# Load environment variables from previous run
source "$_gpg_agent_env" 2> /dev/null
# Start gpg-agent if not started.
if [[ -z "$GPG_AGENT_INFO" && ! -S "${GNUPGHOME:-$HOME/.gnupg}/S.gpg-agent" ]]; then
if [[ -z "$GPG_AGENT_INFO" && ! -S "${_gpg_agent_socket}" ]]; then
# Start gpg-agent if not started.
if ! ps -U "$LOGNAME" -o pid,ucomm | grep -q -- "${${${(s.:.)GPG_AGENT_INFO}[2]}:--1} gpg-agent"; then
if ! ps -U "$LOGNAME" -o pid,ucomm | grep -q "gpg-agent"; then
mkdir -p "$_gpg_agent_env:h"
eval "$(gpg-agent --daemon | tee "$_gpg_agent_env")"
fi
@ -48,7 +50,7 @@ if grep '^enable-ssh-support' "$_gpg_agent_conf" &> /dev/null; then
fi
# Clean up.
unset _gpg_agent_{conf,env}
unset _gpg_agent_{conf,env,socket}
# Disable GUI prompts inside SSH.
if [[ -n "$SSH_CONNECTION" ]]; then

View File

@ -35,7 +35,6 @@ fi
if [[ -S "$SSH_AUTH_SOCK" && "$SSH_AUTH_SOCK" != "$_ssh_agent_sock" ]]; then
mkdir -p "$_ssh_agent_sock:h"
ln -sf "$SSH_AUTH_SOCK" "$_ssh_agent_sock"
export SSH_AUTH_SOCK="$_ssh_agent_sock"
fi
# Load identities.

View File

@ -23,7 +23,7 @@ if ([[ "$TERM_PROGRAM" = 'iTerm.app' ]] && \
_tmux_iterm_integration='-CC'
fi
if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" && "$TERM_PROGRAM" != "vscode" && "$TERMINAL_EMULATOR" != "JetBrains-JediTerm" ]] && ( \
if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" && -z "$VSCODE_RESOLVING_ENVIRONMENT" && "$TERM_PROGRAM" != "vscode" && "$TERMINAL_EMULATOR" != "JetBrains-JediTerm" ]] && ( \
( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' remote ) ||
( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' local ) \
); then