diff --git a/gumssh b/gumssh index b0e5819..de1f9cb 100755 --- a/gumssh +++ b/gumssh @@ -24,9 +24,9 @@ done < "${SSH_CONFIG}" # Print each member of logins array on a new line and pipe to gum choose. # Store selection. -selection=$(printf "%s\n" "${hostn_array[@]}" | gum choose --limit=1) +selection=$(printf "%s\n" "${hostn_array[@]}" | gum choose --header="SSH Host" --limit=1) -# If $selection is non-empty, pass it to the ssh -X command. -if test -n "${selection}"; then +# If $selection is not aborted by user, pass it to the `autossh -M 0` command. +if [ "${selection}" != "user aborted" ]; then autossh -M 0 "${selection}" fi