Keepassxc: [2.4.0] "copy password" shortcut does not work after searcing

Created on 21 Jan 2019  Â·  12Comments  Â·  Source: keepassxreboot/keepassxc

Expected Behavior

Using "CTRL+F" to search an entry in the database and then hitting "CTRL+C" should select the first password in the found list.

Current Behavior

After searching, "CTRL+C" does not do anything, even though the search results seems to have a "strong" focus (at least visually)

Possible Solution

This might be a result of the shortcut context set solely to the widget and not the app/window

Steps to Reproduce

  1. hit "ctrl+f", search something
  2. hit "ctrl+c" to copy the password
  3. try to paste it into any other app

Debug Info

KeePassXC - Version 2.4.0
Revision: b59fd6d

Libraries:

  • Qt 5.11.3
  • libgcrypt 1.8.4

Operating system: Debian GNU/Linux buster/sid
CPU architecture: x86_64
Kernel: linux 4.19.0-1-amd64

Enabled extensions:

  • Auto-Type
  • Browser Integration
  • SSH Agent
  • KeeShare (signed and unsigned sharing)
  • YubiKey
ux

Most helpful comment

I am considering putting just this specific CTRL+C functionality back in. The reason it was removed was to remain consistent with the rest of the UI experience of not copying passwords unless the entry was selected. In this case, it does make sense to allow it as long as there is no text selected in the search field.

All 12 comments

This was explicitly disabled. You need to hit down arrow first to actually select the entry than ctrl+c. I agree the selection indicator is misleading and perhaps that should be fixed.

Unless me and @apollo13 are the only outliers who used the previous workflow, you might want to mention this in the changelog. ¯\_(ツ)_/¯

I am considering putting just this specific CTRL+C functionality back in. The reason it was removed was to remain consistent with the rest of the UI experience of not copying passwords unless the entry was selected. In this case, it does make sense to allow it as long as there is no text selected in the search field.

I also noticed this change in behavior since v2.3.x. Would appreciate if it worked as before.

Many thanks, can't wait for the next release :)

@droidmonkey thanks, could you also add the other entry copy commands (ctrl+b username, ctrl+t TOTP) now that copy password is there? don't see why the same logic shouldn't apply

Yes absolutely, those are far less contentious because they don't share the "common" shortcut that ctrl+c does.

Thanks for putting this back in. I feel so happy it turned out not a few people loved the feature I implemented. 😂

Here's my quick solution to make other shortcuts work in search mode.

From ec08832384f39c41c03d943edec5b28dfb4acb44 Mon Sep 17 00:00:00 2001
From: Akinori MUSHA <[email protected]>
Date: Sun, 5 May 2019 21:52:31 +0900
Subject: [PATCH] Make entry shortcuts when search is active

---
 src/gui/MainWindow.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp
index 0d95f602..ac36a500 100644
--- a/src/gui/MainWindow.cpp
+++ b/src/gui/MainWindow.cpp
@@ -528,8 +528,8 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)

         switch (mode) {
         case DatabaseWidget::Mode::ViewMode: {
-            // bool inSearch = dbWidget->isInSearchMode();
-            bool singleEntrySelected = dbWidget->numberOfSelectedEntries() == 1 && dbWidget->currentEntryHasFocus();
+            bool inSearch = dbWidget->isSearchActive();
+            bool singleEntrySelected = dbWidget->numberOfSelectedEntries() == 1 && (dbWidget->currentEntryHasFocus() || inSearch);
             bool entriesSelected = dbWidget->numberOfSelectedEntries() > 0 && dbWidget->currentEntryHasFocus();
             bool groupSelected = dbWidget->isGroupSelected();
             bool recycleBinSelected = dbWidget->isRecycleBinSelected();
-- 
2.21.0

@knu this works but not very reliable, there needs to be some fine tuning of "selecting" the top entry after a search completes.

@droidmonkey Do you mean the top entry (of the sorted result) should be automatically selected after a search completes? Currently, the first match seems to be active.

I tested your patch and found that if you type in a search request, the extended keyboard shortcuts do not work. If you modify the search request (after it completes the first time) then the shortcuts work. Indicates an initialization issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Throne3d picture Throne3d  Â·  3Comments

shaneknysh picture shaneknysh  Â·  3Comments

shyim picture shyim  Â·  3Comments

rugk picture rugk  Â·  3Comments

mstarke picture mstarke  Â·  3Comments