From 4d1df569e228daccefc7dc129871eca99591c772 Mon Sep 17 00:00:00 2001 From: Theoreticallyhugo Date: Wed, 28 Aug 2024 17:30:01 +0200 Subject: [PATCH] feature/adding option to hide ssh-session-flag when not conntected via ssh --- scripts/ssh_session.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/ssh_session.sh b/scripts/ssh_session.sh index 92daba54..2cf69b57 100755 --- a/scripts/ssh_session.sh +++ b/scripts/ssh_session.sh @@ -3,6 +3,9 @@ # setting the locale, some users have issues with different locales, this forces the correct one export LC_ALL=en_US.UTF-8 +current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source $current_dir/utils.sh + show_ssh_session_port=$1 parse_ssh_port() { @@ -111,7 +114,9 @@ main() { user=$(get_info whoami) # Only show port info if ssh session connected (no localhost) and option enabled - if $(ssh_connected) && [ "$show_ssh_session_port" == "true" ] ; then + if $(get_tmux_option "@dracula-show-ssh-only-when-connected" false) && ! $(ssh_connected); then + echo "" + elif $(ssh_connected) && [ "$show_ssh_session_port" == "true" ] ; then port=$(get_info port) echo $user@$hostname:$port else