In addition to that, why do we need env vars at all? We can simply pass them as arguments to passexec script. It's up to the users to use it or ignore it.
Or do some string substitution in the command, e.g.
/path/to/passexec.sh $HOST$ $PORT$
or similar, so the user has even more flexibility. I know that is done in PEM in a few places, possibly in pgAdmin too, though I don't recall offhand (if it is, we should be consistent on how the parameters are notated).