From 08a01af32e49dd1c1e1087d9f3910137ee4e2c35 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Tue, 11 Mar 2025 11:43:02 -0500 Subject: Make sure ssh-agent runs --- dot_config/zsh/dot_zshrc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dot_config/zsh/dot_zshrc b/dot_config/zsh/dot_zshrc index 350571a..036bfac 100644 --- a/dot_config/zsh/dot_zshrc +++ b/dot_config/zsh/dot_zshrc @@ -33,6 +33,14 @@ if [ -x "$(command -v gem)" ]; then export PATH="$PATH:$GEM_HOME/bin" fi +# Make sure ssh-agent runs +if ! pgrep -u "$USER" ssh-agent > /dev/null; then + ssh-agent -t 1h > "$XDG_RUNTIME_DIR/ssh-agent.env" +fi +if [ ! -f "$SSH_AUTH_SOCK" ]; then + source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null +fi + # Enable colors and change prompt: autoload -U colors && colors # Load colors #stty stop undef # Disable ctrl-s to freeze terminal. @@ -92,4 +100,4 @@ PS1="\[\033]133;D;\007\]\[\033]133;A;\007\]$PS1\[\033]133;B;\007\]" # To customize prompt, run `p10k configure` or edit ~/.config/zsh/. p10k.zsh. [[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh -[[ ! -f ~/.config/zsh/keybindings.zsh ]] || source ~/.config/zsh/keybindings.zsh \ No newline at end of file +[[ ! -f ~/.config/zsh/keybindings.zsh ]] || source ~/.config/zsh/keybindings.zsh -- cgit v1.2.3