From 662ebf018222bf1120fcfee0c99563352e207b6e Mon Sep 17 00:00:00 2001 From: Jeffrey Serio <23226432+hyperreal64@users.noreply.github.com> Date: Mon, 13 May 2024 02:36:48 -0500 Subject: [PATCH] Check if selection != 'user aborted' --- gumssh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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