From 4bada3b6df8dfbed07869de98589c44b81f9ca20 Mon Sep 17 00:00:00 2001 From: sebastian Date: Fri, 9 May 2025 09:37:24 +0200 Subject: [PATCH] Add check if zsh session is running in xfce4-terminal --- dot_zshrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dot_zshrc b/dot_zshrc index 1ff6a37..566b885 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -87,10 +87,10 @@ if [ -f ~/.config/common_aliases ]; then . ~/.config/common_aliases fi - - - -if [ -z "$TMUX" ] && [ ${UID} != 0 ] +# Determin Termanial Type +MYTERMINAL=$(basename "/"$(ps -o cmd -f -p $(cat /proc/$(echo $$)/stat | cut -d \ -f 4) | tail -1 | sed 's/ .*$//')) +# Attach to TMUX session if not already done and only if we're in xfce4-terminal (but not e.g. PyCharm) +if [ -z "$TMUX" ] && [ ${UID} != 0 ] && [[ "$MYTERMINAL" == "xfce4-terminal" ]] then #tmux new-session -A -s main tmux attach || tmux new