I wrote LD_LIBRARY_PATH both in .bashrc and .bash_profile.

However, if I started emacs in terminal using emacs, LD_LIBRARY_PATH is shown in getenv. If I started it using GUI, there is no such variable.

I am on ubuntu 20.04. How could I make GUI started emacs have same env vars as terminal started one?

  • What's the question? "Any ideas?" isn't a specific question.
    – Drew
    Jul 12 '20 at 2:23
  • @Drew Tks for your comment. I edited accordingly:P
    – spacegoing
    Jul 12 '20 at 2:26
  • This is not really an emacs question: it really depends on the GUI, and how it is started. I would suggest you ask the question on the Unix & Linux SE site - and specify which GUI you are using.
    – NickD
    Jul 12 '20 at 3:16
  • Your GUI isn't a shell, so there's no reason why it would read your bash init scripts. You either need to figure out how to configure the environment for your GUI, or else how to change the way the GUI launches Emacs so that it adds things to the environment. Alternatively, some people use github.com/purcell/exec-path-from-shell to make Emacs itself process shell init files.
    – phils
    Jul 12 '20 at 3:59
  • 1
    The environnment vars are inherited from the program that launched Emacs (that's true for all programs), so what you're seeing is that your DE (desktop environment) has a different set of env-vars than your shell (because you set env vars in your shell's startup script). Nothing Emacs can do about it.
    – Stefan
    Jul 12 '20 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.