Skip to content

Commit

Permalink
feature/adding option to hide ssh-session-flag when not conntected vi…
Browse files Browse the repository at this point in the history
…a ssh
  • Loading branch information
Theoreticallyhugo committed Aug 28, 2024
1 parent 71f1ce6 commit 4d1df56
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/ssh_session.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4d1df56

Please sign in to comment.