From 17d1122cce601ed837c50121a29261d984ee068b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 20 Feb 2021 20:55:03 +0000 Subject: [PATCH] more ui stuff --- lgsm/functions/command_send.sh | 6 +++++- lgsm/functions/core_messages.sh | 9 ++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/command_send.sh b/lgsm/functions/command_send.sh index 67bb04849..4b653c0be 100644 --- a/lgsm/functions/command_send.sh +++ b/lgsm/functions/command_send.sh @@ -5,12 +5,15 @@ # Website: https://linuxgsm.com # Description: Send command to the server tmux console. +commandname="SEND" +commandaction="Send" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set check.sh if [ -z "${userinput2}" ]; then fn_print_header - fn_print_information_nl "Send a command to to the console." + fn_print_information_nl "Send a command to the console." fi check_status.sh @@ -21,6 +24,7 @@ if [ "${status}" != "0" ]; then echo "" commandtosend=$( fn_prompt_message "send: " ) fi + echo "" fn_print_dots "Sending command to console: \"${commandtosend}\"" tmux send-keys -t "${servicename}" "${commandtosend}" ENTER fn_print_ok_nl "Sending command to console: \"${commandtosend}\"" diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index 387e95e91..a56ade188 100755 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -361,13 +361,12 @@ fn_prompt_yn(){ # Prompt for message fn_prompt_message(){ - local prompt="$1" while true; do + unset prompt + local prompt="$1" read -e -p "${prompt}" -r answer - echo -e "${answer}" - if ! fn_prompt_yn "Continue?" Y; then - exitcode=0 - core_exit.sh + if fn_prompt_yn "Continue" Y; then + break; fi done echo "${answer}"