This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-24
Channels
- # babashka (11)
- # beginners (62)
- # calva (9)
- # cider (7)
- # clj-kondo (18)
- # cljfx (2)
- # cljsrn (4)
- # clojure (55)
- # clojure-australia (3)
- # clojure-dev (2)
- # clojure-europe (39)
- # clojure-italy (3)
- # clojure-nl (3)
- # clojure-spec (5)
- # clojure-uk (5)
- # clojured (7)
- # clojurescript (16)
- # clojureverse-ops (2)
- # conjure (22)
- # cursive (12)
- # data-science (13)
- # datomic (8)
- # duct (7)
- # emacs (11)
- # events (1)
- # fulcro (12)
- # helix (10)
- # integrant (21)
- # introduce-yourself (5)
- # jobs (2)
- # jobs-discuss (16)
- # lsp (1)
- # malli (5)
- # meander (7)
- # membrane (9)
- # pathom (9)
- # reitit (5)
- # releases (3)
- # ring (2)
- # sci (18)
- # shadow-cljs (35)
- # sql (15)
maaning
Meeting up with all of my actual colleagues for an actual social get-together tomorrow. Kinda weird after all of this time!
Morning !
Morning!
Hey folks, I’m having and interesting issue - can’t load env. variables into the repl started in Emacs, on the other hand Clojure repl started in terminal loads all variables. Any ideas? Mac OS Emacs 27.2 ZSH
Is Emacs started from the Shell or as a standalone application?
I just have (setenv "FOO" "bar")
in my emacs config on macOS. I think there is another way to do it on macOS, but I forget what it is
https://superuser.com/questions/1609942/how-to-set-environment-variables-on-macos-using-a-gui
@U0N9SJHCH Standalone app
This might help https://github.com/purcell/exec-path-from-shell
This plus direnv
also seems to work for the case when I use that https://github.com/purcell/envrc
Couldn’t solve the issue 🤷 tried all packages and configurations. Trying terminal-based emacs.
What happens if you do M-x setenv
, then enter FOO, then bar, then start a repl (after running setenv), and execute (System/getenv "FOO")
in it? If that works, and you have only a small set of variables that you need, (setenv "FOO" "bar")
in your config should work
Yeah and also if I provide a var alias in exec-path-from-shell-copy-env
then Emacs GUI loads the variable, but the project has dozens of such vars, and I wonder why the library doesn’t automatically load login shell env-vars.
Presumably macOS doesn't make those available to applications. Doesn't exec-path-from-shell start a shell process to get them?
If I had a lot of variables, specific to one project, I would put exports for them in .envrc in the project directory, run direnv allow
in there in a shell, then use envrc
Surprisingly enough I encountered the same issue in Emacs GUI in Manjaro Linux machine :thinking_face: I thought MacOS/M1 was to blame
On Linux, I think it depends on where you set them. Possibly /.profile is sourced when Xorg starts, but not /.bashrc (or the latter might exit early when not being used in an interactive shell).
@U015KH5ENEM Thanks! it turns out zsh keeps env variables in .zshenv
and Emacs GUI managed to eventually source those vars.

@U2HBNQQBE how did you fix it in the end?
@U0525KG62 added vars to .zshenv