`copy-username` not working with `pass` anymore?

Hi all,

I use the pass password manager. When @aartaka and @ambrevar first introduced copy-username, it worked properly on my system. However, for the past few days, I have been getting a No username found message after selecting a candidate which I know has worked in the past. Before I try to debug this and/or submit an issue, I’d like to know whether any of you who uses pass could tell me whether they are experiencing the same issue.

Thanks a lot!

EV

Yes, I am getting this too. The log reads

<INFO> [16:28:28] Password saved to clipboard for 45 seconds.
<INFO> [16:28:28] No username found.

Thanks for reporting, this is a bug I introduced in 6f0b9b612fdc996b7020441fa15beb2a504445e4. Should be fixed with 5d50afaf98221bd7e1a5d6e75798519c47fe531e.

Thanks a lot @ambrevar, it is now working :slight_smile:

How am I supposed to select a password manager?

It is supposed to detect your password manager automatically. I assume it is not doing so?

No, I don’t think so - or the wrong one. I have both pass and keepassxc in my path, wanting to use the later. I guess, here is the problem:

Hence, an easy workaround is to push the 'keepassxc-interface into password::*interfaces* in the init file.

However, I have organized my passwords in folders in the kdbx file and this prevents the lookup of passwords. Apparently, the separator / is not treated correctly when the keypassxc-cli command is built (folder/ is passed to the cli instead of folder/account).

The above approach you’ve found does in fact work, but it is not the standard way to do things. Should the implementation change in the future, then you may find yourself with a broken init :open_mouth:

In this case, if you want to force a specific editor, you can customize the slot password-interface of the buffer class. Therefore something like the following should be possible:

(define-configuration buffer
  ((password-interface (make-instance 'password::keepassxc-interface :master-password "xyz"))))

the above is of course pseudocode, but you get the idea. You can create exactly the kind of object that you want for the password-interface slot of the buffer class.

I hope that helps!

1 Like

You can see the class definition here:

(define-class keepassxc-interface (password-interface)
  ((executable (pathname->string (sera:resolve-executable "keepassxc-cli")))
   (password-file)
   (master-password nil
                    :type (or null string))
   (entries-cache nil
                  :type list
                  :documentation "The cache to speed the entry listing up."))
  (:export-class-name-p t)
  (:export-accessor-names-p t)
  (:accessor-name-transformer (hu.dwim.defclass-star:make-name-transformer name)))

and the file is here: nyxt/password-keepassxc.lisp at master · atlas-engineer/nyxt · GitHub

Your code is working perfectly, actually. I have the same thing in my config, except that I instantiate password:user-keepassxc-interface instead of password:keepassxc-interface :slight_smile:

Well, good to know :slight_smile:

I am new to Nyxt, and have a very basic question about login/password managment.

  1. I have KeePassXC installed, and it has a database of saved logins and passwords that I exported from Firefox.
  2. I have in my init.lisp
(define-configuration buffer
  (
    ;; Emacs key  bindings set in auto-config.lisp.
    ;; We are using KeePassXC for password management:
    (password-interface (make-instance 'password:keepassxc-interface))
    )
  )

and also

;; Location of password file used by KeePassXC:
(define-configuration password:keepassxc-interface
  ((password:password-file "/home/ko/personal/Passwords.kdbx")))
  1. So my basic question is: when I visit a website for which I have a saved login and password in the above file, what can I do (Nyxt commands) to fill in my username and password using the stored data?

Thanks.

I think you’re necrobumping an older thread but I admit that I don’t know the Nyxt discourse policy about that :sweat_smile:

If i get your question right, the commands to interact with the password manager are copy-username and copy-password.
Both opens up a prompt filled up with a simplifield version of the link of the current URL (at least for the pass store manager) and you can modify the search string or press enter on the relevant entry.
There is no auto-filling as of now in Nyxt as it is pretty complex to get right (how to be sure that you’re not filling the password of the user in the wrong place…? Nobody would want that, right? It could leak your password if used on improper inputs).
So you have to focus the proper field on the web page (with follow-hint for instance) and then paste the password which now is in your clipboard with the shortcut C-y.

I hope it helps and does work as I never used the keepassxc interface.

Thanks, I use KeePassXC because the Nyxt documentation recommends it.
Anyhow, I checked copy-username but it seems to do the opposite of what I want.
What I want is for it to tell me what the username is for the site that I’m on. But first it asks me for a password file (probably a sign that KeePassXC is not working), and after I tell it the location of the file it prompts me with File password[1] . So it seems to want me to tell it what the username is.

(By the way, I do know that auto-fill isn’t implemented in Nyxt yet.)

This File password prompt is the password to your KeePassXC database. After you input it, you’ll get a prompt with available entries/usernames.

I guess we can do a better work naming prompts in this case. Something like Database password or Password store password would work better…

P. S. Necrobumping is not good, do open new topics instead!

Thanks, I’m opening a new thread!