Skip to content

Instantly share code, notes, and snippets.

@TauPan
Created October 4, 2019 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TauPan/cb044caf487fee6d4dfae02b9fc11fc5 to your computer and use it in GitHub Desktop.
Save TauPan/cb044caf487fee6d4dfae02b9fc11fc5 to your computer and use it in GitHub Desktop.
Tell emacs about (ssh-related) environment variables from your shell, via emacsclient.
emacsclient_set_env_vars () {
for name in $@
do
emacsclient -e "(setenv \"$name\" \"$(eval echo \${${name}})\")"
done
}
ssh-copy-ssh-vars-to-emacs () {
emacsclient_set_env_vars $(env|grep SSH_|cut -f1 -d=)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment