The Copy attribute to clipboard > TOTP Seed and Copy attribute to clipboard > TOTP Settings menu options don't seem to work correctly.
I would expect that the Seed/Settings get copied to the clipboard as the name on the tin would indicate.
The clipboard appears to be cleared when these menu options are used.
Unknown.
Copy attribute to clipboard > TOTP SeedIt doesn't bother me, as I don't use the feature. But I noticed it wasn't working when I tried it wondering what it would copy.
KeePassXC - Version 2.3.0-snapshot
Build Type: Snapshot
Revision: 3f7f1aa
Libraries:
Operating system: Arch Linux
CPU architecture: x86_64
Kernel: linux 4.15.5-1-hsw
Enabled extensions:
All customs attributes aren't copy to clipboard.
Try add a test propertie and select Copy attribute to clipboard > TOTP Seed
nothing in clipboard.
Title + URL work.
Works for me. Please check your clipboard timeout settings. KeePassXC will clear the clipboard after a few seconds.
It's set to clear the clipboard after 10 seconds, and I'm well under that time limit.
I experience the same behavior as @OlivierMary -- the Title, Username, Password, current TOTP code, etc all copy to the clipboard correctly. The TOTP settings/seed do not.
I suspect this is related to #1546.
I need to dive into the code
I complete / correct my last comment
Try add a test propertie and select Copy attribute to clipboard > **test**
I got nothing in clipboard.
I observe that on Linux, not on windows.
I can't reproduce this neither with 2.3.0 and also with release/2.3.1 branch
Please insert step to reproduce
diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp
index e4ee21a3..2e97c3f8 100644
--- a/src/gui/DatabaseWidget.cpp
+++ b/src/gui/DatabaseWidget.cpp
@@ -597,6 +597,10 @@ void DatabaseWidget::copyAttribute(QAction* action)
if (!currentEntry) {
return;
}
+ printf("Copying attribute %s, value is '%s' with placeholders resolved '%s'\n",
+ action->text().toLatin1().data(),
+ currentEntry->attributes()->value(action->text()).toLatin1().data(),
+ currentEntry->resolveMultiplePlaceholders(currentEntry->attributes()->value(action->text())).toLatin1().data());
setClipboardTextAndMinimize(currentEntry->resolveMultiplePlaceholders(currentEntry->attributes()->value(action->text())));
}
Shows:
Copying attribute TOTP &Seed, value is '' with placeholders resolved ''
Seems like it should be dead-easy to reproduce.
Slightly further:
diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp
index e4ee21a3..1468241a 100644
--- a/src/gui/DatabaseWidget.cpp
+++ b/src/gui/DatabaseWidget.cpp
@@ -597,6 +597,16 @@ void DatabaseWidget::copyAttribute(QAction* action)
if (!currentEntry) {
return;
}
+ printf("Copying attribute %s, value is '%s' with placeholders resolved '%s'\n",
+ action->text().toLatin1().data(),
+ currentEntry->attributes()->value(action->text()).toLatin1().data(),
+ currentEntry->resolveMultiplePlaceholders(currentEntry->attributes()->value(action->text())).toLatin1().data());
+
+ printf("Attribute keys:\n");
+ for (QString key : currentEntry->attributes()->keys())
+ {
+ printf(" '%s'\n", key.toLatin1().data());
+ }
setClipboardTextAndMinimize(currentEntry->resolveMultiplePlaceholders(currentEntry->attributes()->value(action->text())));
}
Copying attribute TOTP &Seed, value is '' with placeholders resolved ''
Attribute keys:
'Notes'
'Password'
'TOTP Seed'
'TOTP Settings'
'Title'
'URL'
'UserName'
It's the & that appears to be screwing it up.
Are you using KDE as desktop environment?
https://keepassxc.org/docs/#faq-kdeaccelerators
Now I remember :smile:
Closing since the solution is in the faq and this is not a KeePassXC bug