Closed papadakis-k closed 8 months ago
Thanks for sharing this tip. The main problem this library tries to solve is that sometimes initial-environment
would be missing some environment variable settings that are needed for executing programs with start-process
, compile
and shell-command
etc. Certainly for launching a terminal it's unlikely to be necessary, as the terminal will start up a shell with all the user's preferred environment settings.
I guess you're suggesting that with your snippet above, a user could freely put PATH=/some/dir:$PATH
in their startup files. But then they could still get duplicate PATH entries etc. if Emacs is first started in a terminal. So personally I prefer to set PATH etc. explicitly in my shell, ie. not assume anything about the parent environment. Different trade-offs I suppose.
This is not really an issue, I just want to point out an alternative, a more Emacs way to avoid the double classpath issue, that I personally use.
You can use the following snippet to start a term:
i.e. override the process-environment with dynamic binding and launch your command (shell, term, vterm, etc).
About Vterm specifically, there is another way which doesn't need dynamic binding. You can do:
(setq vterm-environment initial-environment)
Thanks. Kudos for the nice work done here.