hubisan / emacs-wsl

Install and run Emacs with the Windows Subsystem for Linux (WSL 2) in Windows 10 or 11.
568 stars 43 forks source link

Add `ssh-ident` under Optional Additions #61

Closed hubisan closed 4 months ago

hubisan commented 8 months ago

The WSL Git Credential Manager doesn't support SSH remotes.

ssh-ident can be uses as a simple way for using SSH with a credential manager. ssh-ident starts the SSH agent for a specific identity on demand (once you actually need them) and sets a customizable lifetime for that identity. Another approach is to launch the SSH agent during WSL startup. However, this prompts for a password every time, even if it's not needed.

The following configuration is necessary to enable ssh-ident to work seamlessly with Magit:

;; Integrate with ssh-ident to ask for ssh password:
  (add-to-list 'magit-process-password-prompt-regexps
               "^\\(Enter \\)?[Pp]assphrase for [^ ]*: ?$")
  (add-to-list 'magit-process-password-prompt-regexps
               "^Bad passphrase, try again for [^ ]*: ?$")