From adcb62e6ccdcfcc2b3ba858b1eb3e263282e02c7 Mon Sep 17 00:00:00 2001 From: juancwu Date: Wed, 4 Feb 2026 00:29:25 +0000 Subject: [PATCH] (bash,tmux) check for empty GIT_KEY before running stmux --- bash/bashrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bash/bashrc b/bash/bashrc index 57fad04..ffbe37e 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -238,6 +238,11 @@ parse_git_branch() { # Starts a new secure session with auto-wipe enabled stmux() { + if [ -z "$GIT_KEY" ]; then + echo "Missing GIT_KEY environment variable." + return + fi + ssh-agent sh -c "tmux new-session -s secure \ \; set-hook client-detached \"run-shell 'SSH_AUTH_SOCK=\$SSH_AUTH_SOCK ssh-add -D'\" \ \; send-keys \"ssh-add $GIT_KEY\" C-m"