diff --git a/anyterm-cmd b/anyterm-cmd index c511d68..b7c916e 100644 --- a/anyterm-cmd +++ b/anyterm-cmd @@ -8,6 +8,10 @@ set -eo pipefail while : ; do echo -n "Username: " read U + if [[ -z "$U" ]]; then + echo "Disconnecting." + exit + fi # Make sure it does not start with a "-" and only contains valid # username characters. if [[ "$U" =~ ^[A-Za-z0-9_][A-Za-z0-9_-]*$ ]]; then