Kevin Kofler via devel writes:
Sam Varshavchik wrote:
> I miss the days when gpg needed a passphrase it simply prompted a message
> on standard output, turned off tty echo, and just read the password that I
> typed in.
>
> But that was too simple, primitive, and bulletproof. I guess that things
> can't be as simple any more, and the forward march of progress is
> unstoppable.
That approach simply does not work for GUI applications.
Sure. But it seems that more often that not making things work for GUI
applications must mean that plain text interface ends up being broken.
if (isatty(2))
{
/* Existing code, that prompts for a password or reads it from stdin */
}
else
{
/* The GUI equivalent */
}
Now, your terminal interface continues to work as before, and you can
provide a GUI interface too.
But, for some reason that I do not understand, the existing terminal
interface always gets broken.