Fork me on GitHub
#clojure-europe
<
2021-06-24
>
dharrigan06:06:01

Good Morning! Hope everyone is doing grand!

RAMart06:06:16

Next :clojureD 2021 talk now online: https://www.youtube.com/watch?v=A0TafHXszgM

🔥 7
simongray06:06:33

Meeting up with all of my actual colleagues for an actual social get-together tomorrow. Kinda weird after all of this time!

💇 2
👯 2
pez06:06:43

Morning!

jkxyz08:06:25

Morning!

agigao15:06:55

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

javahippie15:06:35

Is Emacs started from the Shell or as a standalone application?

djm15:06:11

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

djm15:06:38

This plus direnv also seems to work for the case when I use that https://github.com/purcell/envrc

djm15:06:39

(use-package envrc
 :config
 (envrc-global-mode))
or whatever

agigao20:06:45

Couldn’t solve the issue 🤷 tried all packages and configurations. Trying terminal-based emacs.

djm06:06:42

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

agigao07:06:27

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.

djm08:06:04

Presumably macOS doesn't make those available to applications. Doesn't exec-path-from-shell start a shell process to get them?

djm08:06:50

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

agigao08:06:35

Surprisingly enough I encountered the same issue in Emacs GUI in Manjaro Linux machine :thinking_face: I thought MacOS/M1 was to blame

agigao08:06:28

Yeah, me too, but that’s how the client has it done across all projects.

agigao08:06:08

Regarding shell process - not sure, is there a way to check?

djm08:06:38

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).

djm08:06:55

Use the source, Luke 😁

agigao08:06:32

@U015KH5ENEM Thanks! it turns out zsh keeps env variables in .zshenv and Emacs GUI managed to eventually source those vars.

👍 3
thanks3 3
otfrom08:06:32

@U2HBNQQBE how did you fix it in the end?

agigao08:06:18

@U0525KG62 added vars to .zshenv