Can you provide script example you are using for input. Maybe I can help if I see the input code you are using.
I found writing to a /tmp/file and then read back in to a variable works for --file --list & --form and not terminal popup.
You might be needing to $fpipe your input and then echo it to variable.
(I am not a programmer but, me or someone else would have a better idea if example code is provided)
Bobby