Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/hide ssh-session when not conntected #284

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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