keepassxc icon indicating copy to clipboard operation
keepassxc copied to clipboard

Missing password `MIME` type with `xkeepassxc-cli`

Open ccjmne opened this issue 3 months ago • 1 comments

Have you searched for an existing issue?

  • [x] Yes, I tried searching and reviewed the pinned issues

Brief Summary

I may be missing something; my apologies if that's the case.

When using the GUI, the MIME type x-kde-passwordManagerHint (not technically "MIME"), see https://github.com/keepassxreboot/keepassxc/issues/12696) is adequately set upon copying passwords. However, in trying out xkeepassxc-cli clip, it appears to be missing.

I can see it's indeed implemented somewhere here: https://github.com/keepassxreboot/keepassxc/blob/f484d7f5ed00d77a6cd5f913663f5c437707901a/src/gui/Clipboard.cpp#L55-L65 But that seems to belong squarely to the GUI side of things only.

Could we align the CLI tool as well?

Steps to Reproduce

  1. Open the GUI,
  2. Ctrl-C some entry,
  3. see its password marked as such in any tool you may use to inspect your clipboard. For example, fcitx5's built-in clipboard add-on would highlight passwords as such (and possibly hide them), as implemented somewhere there: https://github.com/fcitx/fcitx5/blob/39274f29116681a16c3a0b02b814369c6530df09/src/modules/clipboard/clipboard.h#L45

Conversely,

  1. keepassxc-cli clip personal.kdbx --attr password
  2. See, for instance, fcitx5 have no qualms about displaying your passwords.

Operating System

Distribution: linux-zen/Arch Linux Compositor: Wayland/niri

ccjmne avatar Nov 20 '25 00:11 ccjmne

Hmmm, well that is awkward. CLI rolls it's own clipboard management because of a "lack of an event loop" which shouldn't really be a problem since we can create an event loop prior to using QClipboard. Requires a little investigation but should be solvable to use one code path for clipboard usage.

droidmonkey avatar Nov 20 '25 01:11 droidmonkey