Just reread your post. It sounds like you're saying your dialog works fine, but you can't paste data from your clipboard into the form it displays. If that's the case, then try using
Ctrl+Shift+V. I don't think the Mac has an
Insert key, but if it does, you can also try using
Shift+Insert. These sometimes use different code paths and one will work when the others don't.
I just tried your script. It works strangely on my KDE/kubuntu 18.04 system. I can use the arrow keys to get to any field and
Ctrl+Shift+V works (
Ctrl+V does not), but as soon as I paste into any one field, the dialog exits. If I just type, I can get to all the fields as expected.
One other note: in your code sample, you don't quote your variables, so a user entering a response with embedded white space may produce unexpected results.
-----
Totally unnecessary, but I figured it out, so I might as well share it
You probably know this, but you can avoid having to deal with cleaning up a temporary file (which might remain behind if the script catches a signal such as the user pressing
Ctrl+C while it's running.)
This is a little tricky since you need to extract several separate variables from the dialog output and dialog puts the results on stderr. (This is easier if you can use a GUI dialog manager because they put their results on stdout.)
Code:
#!/bin/bash
## Redirection technique from:
## http://sebthom.de/158-bash-capturing-stderr-variable/
ACCT=$(whoami)
## Still using sed
output=$(dialog --backtitle "YTTS-setup" --title "Dialog - Form" \
--form "\nDialog Welcome YTTS setup $ACCT " 25 60 16 \
"1 git hub truck company name 1:" 1 1 "" 1 34 25 60 \
"2 git hub truck company URL 2:" 2 1 "" 2 34 25 60 \
"3 company abbreviation 3:" 3 1 "" 3 34 25 60 \
"4 company address 4:" 4 1 "" 4 25 25 60 \
"5 company phone Numbers 5:" 5 1 "" 5 34 25 60 \
3>&1 1>&2 2>&3)
##echo "[$output]"
repcomin="$(sed -n 1p <<<$output)"
gitname="$(sed -n 2p <<<$output)"
coabrev="$(sed -n 3p <<<$output)"
address="$(sed -n 4p <<<$output)"
phone="$(sed -n 5p <<<$output)"
echo
echo "repcomin [$repcomin]"
echo "gitname [$gitname]"
echo "coabrev [$coabrev]"
echo "address [$address]"
echo "phone [$phone]"
sleep 2
## Just using a bash array
outarr=($(dialog --backtitle "YTTS-setup" --title "Dialog - Form" \
--form "\nDialog Welcome YTTS setup $ACCT " 25 60 16 \
"1 git hub truck company name 1:" 1 1 "" 1 34 25 60 \
"2 git hub truck company URL 2:" 2 1 "" 2 34 25 60 \
"3 company abbreviation 3:" 3 1 "" 3 34 25 60 \
"4 company address 4:" 4 1 "" 4 25 25 60 \
"5 company phone Numbers 5:" 5 1 "" 5 34 25 60 \
3>&1 1>&2 2>&3))
repcomin="${outarr[0]}"
gitname="${outarr[1]}"
coabrev="${outarr[2]}"
address="${outarr[3]}"
phone="${outarr[4]}"
echo
echo "repcomin [$repcomin]"
echo "gitname [$gitname]"
echo "coabrev [$coabrev]"
echo "address [$address]"
echo "phone [$phone]"