Use gpg2 as the gpg program.
Flush history out on every command prompt.