From 8c497225130a7c5a0162b6c5a87d595255cabe51 Mon Sep 17 00:00:00 2001 From: madumlao Date: Wed, 23 Dec 2020 23:58:48 +0800 Subject: [PATCH] Set the GPG_TTY if not set --- skel/.bashrc | 5 +++++ skel/.zshrc | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/skel/.bashrc b/skel/.bashrc index ac1f51e..8534e1c 100644 --- a/skel/.bashrc +++ b/skel/.bashrc @@ -115,3 +115,8 @@ if ! shopt -oq posix; then . /etc/bash_completion fi fi + +# set GPG TTY +if [ "$GPG_TTY" = "" ]; then + export GPG_TTY=$(tty) +fi diff --git a/skel/.zshrc b/skel/.zshrc index 04e87b3..dc7c0ec 100644 --- a/skel/.zshrc +++ b/skel/.zshrc @@ -71,3 +71,8 @@ SAVEHIST=$HISTSIZE setopt BANG_HIST # Treat the '!' character specially during expansion. setopt HIST_BEEP # Beep when accessing nonexistent history. setopt HIST_LEX_WORDS # parse quotes when parsing history + +# set GPG_TTY +if [ "$GPG_TTY" = "" ]; then + export GPG_TTY=$(tty) +fi