Skip to content

Commit

Permalink
ssh-agent setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Bin committed Jan 3, 2025
1 parent 749114f commit 3db73e3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lisp/init-misc.el
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,18 @@ MATCH is optional tag match."
(kill-new selected)
(message "\"%s\" => kill-ring" selected))))

(defun my-ssh-agency-setup ()
"Help emacsclient to find ssh-agent setup."
(when (and (not (getenv "SSH_AGENT_PID"))
(file-exists-p "~/.ssh/environment"))
(let* ((str (with-temp-buffer
(insert-file-contents "~/.ssh/environment")
(buffer-string))))
(when (string-match "SSH_AGENT_PID=\\([^ ;]+\\);" str)
(setenv "SSH_AGENT_PID" (match-string 1 str)))
(when (string-match "SSH_AUTH_SOCK=\\([^ ;]+\\);" str)
(setenv "SSH_AUTH_SOCK" (match-string 1 str))))))

(defun my-generic-prog-mode-hook-setup ()
"Generic programming mode set up."
(when (buffer-too-big-p)
Expand Down

0 comments on commit 3db73e3

Please sign in to comment.