ifosch / keepass-mode

Emacs mode to open KeePass DB
https://github.com/ifosch/keepass-mode
GNU General Public License v3.0
40 stars 7 forks source link

keepass-mode in windows 10 and native emacs #10

Open deb75 opened 3 years ago

deb75 commented 3 years ago

hello,

I installed keepass-mode on windows 10 (native emacs 28.0.50 through mingw64) along keepassxc 2.6.4

When I open a keepass file I get the message :

'egrep' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

It is in french, it says that the egrep command is not recognized as a internal or external command.

This is strange because I do have egrep installed with mingw64.

I suspect the trouble is here in the code :

(defun keepass-mode-command (group command)
  "Generate KeePass COMMAND to run, on GROUP."
  (format "echo %s | \
           keepassxc-cli %s %s %s 2>&1 | \
           egrep -v '[Insert|Enter] password to unlock %s'"
          (shell-quote-argument keepass-mode-password)
          command
          keepass-mode-db
          group
          keepass-mode-db))

It seems that a pipe is used between keepass-cli and egrep command.

I may be wrong but this relies on a linux shell which is not available when using native emacs on windows 10.

Would it be possible to make keepass-mode more portable towards windows 10 ? I am ready to test any commits if helpful to you

Regards

ifosch commented 3 years ago

I'll take a look, but I'm very time limited right now. I'll try to see if I can switch this depending on the OS and which windows command should be used. In the meanwhile, I don't know if any Windows implementation of grep/egrep would make this work for you. Maybe this one?