Skip to content

Commit

Permalink
Merge pull request #284 from Theoreticallyhugo/feature/show-host-only…
Browse files Browse the repository at this point in the history
…-on-ssh

feature/hide ssh-session when not conntected
  • Loading branch information
ethancedwards8 authored Sep 3, 2024
2 parents bbad087 + 4d1df56 commit bb68856
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 bb68856

Please sign in to comment.