From 7051ef7d96e2e09248ee51ee00cecd34628e3b5f Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Fri, 24 Nov 2023 14:31:20 +0100 Subject: [PATCH] bash: tmux azuto-attach not for root --- .bash_extra | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.bash_extra b/.bash_extra index 6c450d4..66d6a85 100644 --- a/.bash_extra +++ b/.bash_extra @@ -1,7 +1,11 @@ #!/bin/bash ### tmux auto attach -if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then - tmux attach -t default || tmux new -s default + +# Check if the user ID is not 0 (root) +if [ "$EUID" -ne 0 ]; then + if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then + tmux attach -t default || tmux new -s default + fi fi ### keychain