The arguments KGPG is using aren't quoted properly. It passes an argument list like this: [ "konsole", "-e", "gpg", "--gen-key", "--expert" ] instead of this: [ "konsole", "-e", "gpg --gen-key --expert" ] Reproducible: Always This fixes it, and also uses --full-gen-key instead of --gen-key on GPG 2.1+. If we're going "expert" we might as well go all the way. diff --git a/keysmanager.cpp b/keysmanager.cpp index d0073da..8604063 100644 --- a/keysmanager.cpp +++ b/keysmanager.cpp @@ -507,11 +507,17 @@ void KeysManager::slotGenerateKey() KConfigGroup config(KGlobal::config(), "General"); QString terminalApp(config.readPathEntry("TerminalApplication", QLatin1String( "konsole" ))); + + QString gpg_args; + gpg_args += KGpgSettings::gpgBinaryPath() + QLatin1String(" --expert"); + if (GPGProc::gpgVersion(GPGProc::gpgVersionString(QString())) > 0x20100) + gpg_args += QLatin1String(" --full-gen-key"); + else + gpg_args += QLatin1String(" --gen-key"); + QStringList args; args << QLatin1String( "-e" ) - << KGpgSettings::gpgBinaryPath() - + QLatin1String(" --full-gen-key") - + QLatin1String(" --expert"); + << gpg_args; QProcess *genKeyProc = new QProcess(this); genKeyProc->start(terminalApp, args);
Created attachment 101253 [details] patch My copy/pasted diff had a missing include. Also the formatting was ugly. Attaching a patch instead.
It works for me even without the patch, what is your setup? Konsole version etc.?
$ konsole --version konsole 16.08.1 Example of how kgpg currently invokes konsole: $ konsole -e gpg --gen-key --expert Unknown options: gen-key, expert. How it should be quoting: $ konsole -e "gpg --gen-key --expert" <brings up Konsole with gpg key generation prompts>
Could be plasma-related, as I can reproduce it on a machine with Plasma 5.
Git commit af3b40cbb204b69f30b33777b10606a6814276c6 by Rolf Eike Beer, on behalf of Steven Noonan. Committed on 11/10/2016 at 16:16. Pushed by dakon into branch 'master'. slotGenerateKey: correctly invoke GPG for interactive key generation While at it, use --full-gen-key if the given GnuPG binary is new enough. FIXED-IN:16.12.0 Signed-off-by: Steven Noonan <steven@uplinklabs.net> M +10 -3 keysmanager.cpp http://commits.kde.org/kgpg/af3b40cbb204b69f30b33777b10606a6814276c6