Questions tagged [environment]

A set of dynamic variables that can affect the running processes.

Filter by
Sorted by
Tagged with
6
votes
1answer
496 views

How to get the PATH from the SHELL

When launched at system start-up, the Emacs daemon doesn't pick up modifications to the PATH introduced by shell initialization scripts. Emacswiki suggests to use this function to update Emacs' PATH, (...
1
vote
1answer
137 views

How to make emacs shell the same as system terminal experience?

On macOS, using iTerm2. It looks like In Emacs For Mac OS X, it looks like I copied system's ~/.zshrc file to ~/.profile and ~/.bash_profile, but doesn't they read configrations when start emacs?
0
votes
1answer
537 views

How to use doom emacs as a golang ide quickly?

I installed the newest doom emacs on macOS. Also configed language packages as $ emacs ~/.doom.d/init.el :lang (go +lsp) :tools lsp $ ~/.emacs.d/bin/doom sync When I open a .go file, the code became ...
1
vote
1answer
83 views

How to set env values for eshell in emacs on macOS?

If use iTerm on macOS, we can set env values in its terminal. It also set path such as /usr/local/bin/ in ~/.bashrc. But in emacs' terminal as eshell, run kubectl shown kubectl: No such file or ...
0
votes
0answers
116 views

How to set English as the default input method?

For some reason I cannot set english, only british as the input method. I am writing a function to switch language from spanish-postfix to english, but english is not working, only british. I have ...
1
vote
0answers
54 views

Use conda environment in ansi-term

I would like to be able to use conda activate to switch between environments in ansi-term. I am running bash in ansi-term from Emacs 27.1 on MacOS Catalina. Currently, executing conda activate <...
0
votes
1answer
137 views

macos environment variables?

I'd like to set things up so that I can use emacs on multiple computers, with the .emacs.d directory shared amongst them (via DropBox). My solution so far has been to use environment variables which ...
1
vote
1answer
146 views

Bash Environmental Variable Not Recognized

I use Bash for my terminal on Debian. In my .bashrc, I've defined an environmental variable like so: SSH_VAULT_VM="ssh-vault" if [ "$SSH_VAULT_VM" != "" ]; then ...
0
votes
2answers
125 views

Change $PATH once emacs is running

In my shell (Bash), I can switch among several LaTeX distros setting the $PATH variable. E.g.: export PATH=/usr/local/texlive/2016/bin/x86_64-linux:$PATH or export PATH=/usr/local/texlive/2018/bin/...
0
votes
2answers
59 views

Unable to find files with ssh and environment variables

I have installed exec-path-from-shell as well as included the following in my init.el (when (memq window-system '(mac ns x)) (exec-path-from-shell-initialize)) within my ~/.bash_profile I have ...
1
vote
0answers
64 views

How to not display environment variable in org-babel src block?

I want the effect of this: #+BEGIN_SRC shell :dir src CC=gcc-9 make #+END_SRC But I don't want CC=gcc-9 to show up in the output. Is there a way to somehow include the environment variable in the ...
1
vote
1answer
105 views

Function `cd` not working correctly in conjunction with `tramp` and `compile`

For context I am looking at a remote file; for example: /ssh:desktop:/home/user/project/src/file.cpp. I then issue the interactive command compile like so: cd /ssh:desktop:/home/user/project/Release &...
0
votes
2answers
72 views

How does process-environment get initialized and why would it be different from initial-environment?

I'm trying to troubleshoot an issue with my exec-path. It contains a couple of paths prepended to it that I don't want. initial-environment contains the paths that match what I see when I echo $PATH ...
1
vote
1answer
39 views

Emacs on Windows sets DISPLAY to w32

I stumbled upon the fact that Emacs on Windows sets the environment variable DISPLAY to w32 (if the variable is not already set). This causes problems for example with OpenSSH. What is the use case ...
1
vote
1answer
131 views

Run an external program with customized environment/options in current buffer

How can I organize Emacs to run a specific external program with some specific environment/options for the mode or the buffer currently open. My current solution is to use setenv before running the ...
1
vote
0answers
98 views

problems with rbenv integration

I recently changed from rvm to rbenv to manage my ruby environments and gems with bundle instead of rvm gemsets. It worked well and I'm quite happy with the change. The only big problem is to manage ...
2
votes
1answer
133 views

How do I get ein to find conda packages?

I'm trying to use ein to edit a jupyter notebook. I used conda to install the 'turicreate' package in a virtual environment and activated it. When I run the regular browser based jupyter notebook ...
0
votes
0answers
371 views

Use ssh-agent's SSH_AUTH_SOCK value, not macOS' one [duplicate]

When I run (getenv "SSH_AUTH_SOCK"), I get "/private/tmp/com.apple.launchd.K9OEFgxDgw/Listeners". I want to set it to the value that is returned by echo $SSH_AUTH_SOCK on the command line which is ...
1
vote
0answers
38 views

Storing and Loading Non-Static/Multiple Configs

I'm writing an emacs wrapper to a set of scripts that require a lot of config settings to run. These can be variously environment variables, command line parameters and so forth. They should be user ...
0
votes
1answer
190 views

How can I get files and links to open correctly in emacs?

This used to work, but since a recent update, it hasn't. I'm using spacemacs, with this configuration. Links and files don't open as usual. If I open ansi-term, and type xdg-open test.txt, then I see: ...
1
vote
1answer
213 views

Have shell inherit buffer local process-environment

I have made buffer local changes to `process-environment' using the technique described in How can I get buffer-local environment variables via .dir-locals. I then call shell from that buffer. If I ...
4
votes
1answer
1k views

How to check whether ImageMagick is setup correctly on macOS?

I installed emacs on macOS by brew cask install emacs. But the functionality of resizing images doesn't work as expected. So, how to check whether the emacs distribution is built with imagemagick ...
2
votes
1answer
810 views

emacs daemon and ssh agent forwarding

In order to use ssh agent forwarding with emacs in daemon mode, running on a remote server, I've come-up with the following. I have an alias for the client like so: alias emacsclient="update_agent;/...
8
votes
2answers
737 views

Set environment variables for spawned subprocesses

I would like to set the environment variables for a spawned subprocess only. They are controlled by process-environment. The documentation says: binding that variable with let is also reasonable ...
1
vote
0answers
64 views

Emacs doesn't use macOS's /etc/launchd.conf env variables

Emacs doesn't use macOS's /etc/launchd.conf env variables. I have the following there: function addToPATH { case ":$PATH:" in *":$1:"*) :;; # already there *) PATH="$1:$PATH";; # ...
0
votes
1answer
673 views

How should I solve “no such directory” error at CDPATH with environmental variable on Windows 10 Emacs?

I have installed GNU Emacs on Windows 10. When I open it, I get an error. Warning (initialization): An error occured while loading 'c:/Users/[redacted]/AppData/Roaming/.emacs.d/init.el': error: No ...
2
votes
1answer
721 views

Why does emacs (getenv “TERM”) return incorrect data?

I'm running Emacs 25.2.2 on Ubuntu 17.10. Although my environment has TERM=xterm-256color, (getenv "TERM") returns dumb, which is incorrect. Why does (getenv "TERM") return an incorrect value?
2
votes
0answers
149 views

indent items in auctex

What I would like to achieve is a deeper indentation of lines in items in Auctex. \begin{itemize} \item This is what I would like to achieve. The beginning of the second line aligns with ...
2
votes
1answer
379 views

Interpolate environment variables in string

I am trying to write a function that will interpolate the enviroment variables stored in process-environment in a string. For example, if I have the string "This is $Foo and ${Bar}_none and '$skip'" ...
0
votes
1answer
400 views

ansi colors for bash process

I'm trying to get ansi colors from my bash process, but I can't get this to work. (setq shell-process-name "shell-process-name") (setq shell-process-buffer "*shell-process-buffer*") (defun open-...
6
votes
1answer
1k views

How can I get buffer-local environment variables via .dir-locals?

I'm using emacs for many different projects. For some of them, I need, for example, different entries in $PATH, or different $MAKEFLAGS, whatever, you name it... I thought this would be possible ...
3
votes
2answers
2k views

How can I get some environment variables into init.el to construct file paths?

I want to synchronize my emacs configuration through an identical init.el but needs some settings defined according to the host. For instance although init.el will be the same custom-file will vary ...
5
votes
2answers
763 views

What kind of environment variables does Emacs expect to find in .profile, .bash_profile etc?

When I startup spacemacs I get the following message: You appear to be setting environment variables ("PATH") in your .bashrc or .zshrc: those files are only read by interactive shells, so you ...
5
votes
2answers
1k views

How to determine the initial current directory when emacs is run from command line?

How can I determine (from within Emacs) the current directory as it was when the Shell launched emacs from the command line?
0
votes
1answer
170 views

Garbage prepended to PATH

For some reason, some garbage is prepended to my PATH variable in emacs. Testing from eshell: (M+x eshell): ~/projects/rust/logentries-parser/src $ echo $PATH bash: cannot set terminal process group ...
3
votes
1answer
3k views

Package `exec-path-from-shell` isn't setting PATH variables from `.zshenv` on MacOS

I'm running a GUI Emacs compiled from the master git branch on MacOS El Capitan. I'm using the package exec-path-from-shell to set several environment variables I have configured in my ~/.zshenv file. ...
1
vote
0answers
421 views

load environment variables of virtual environment in emacs

What is the best way to load in emacs the environment variables of a virtualenv? I seem to have got virtualenvwrapper.el working. For example, after using venv-workon my_venv, then M-! printenv ...
3
votes
3answers
1k views

How can Emacs set an environment/shell variable in a subordinate shell?

I often use subordinate shells within Emacs. (I instantiate these shells with M-x shell.) I put all these shells under auto-save-mode (through my shell-mode-hook; see below). Is there some way that ...
1
vote
1answer
1k views

UnicodeEncodeError in inferior python under windows

I have recently started using emacs under Windows as my python IDE. I had some struggle getting python convinced that it was allowed to output UTF-8 to my terminal emulator (mintty does support ...
4
votes
1answer
345 views

How can I use 'emacsclient' as $PAGER in eshell with pipe? or any better PAGER which works well with eshell?

When I typed git diff in eshell, it has weird attribute such like print : in every single line, cannot scroll back, and so on. I think this is because the default eshell env PAGER is set as less, and ...
1
vote
1answer
113 views

Separate Environments for each emacsclient

I have a single emacs server that I use for all of my work. It is located on a machine that I ssh into from every location. My 'browse-url is set to run a bash script that ssh's into the machine I am ...
23
votes
2answers
12k views

Using conda environments in emacs

What is the best way to use conda environmets using emacs as a Python IDE? I have got different conda environments while programming in Python: $ conda info -e # conda environments: # django ...
0
votes
1answer
43 views

Exports in compile command

I'm using the Anaconda distribution for Numpy, Ipython etc. and during the installation the following was added to my .bashrc: # added by Anaconda2 2.4.0 installer export PATH="/home/matthias/...
1
vote
1answer
1k views

Missing modules when debugging Python code in Emacs

For a number of reasons - the main one being that Emacs is amazing! - I am trying to do all my Python development at work in Emacs instead of Pycharm, which I was using previously. The one component ...
3
votes
1answer
3k views

How to activate python virtual environment in init file?

How would I activate a specific virtual environment in my init file? I know how to activate it manually, but I don't like to do it every time I start emacs. To activate it manually I used: pyvenv-...
7
votes
3answers
3k views

How to make terminal/shell spawned inside Emacs running on a Mac inherit the environment variables of the native terminal?

The terminal natively on Mac i.e. spawned through Spotlight or Launchpad, adopts the desired environment variables including the customization in ~/.bash_profile. But when I run Emacs (Emacs.app taken ...
6
votes
1answer
2k views

How do I use a remote virtual environment with emacs?

My particular setup is that my code lives on my machine and is mounted via vagrant onto a linux container upon which the virtual env lives. I'd like to be able to edit all the code, including the ...
7
votes
1answer
2k views

emacs command-line-default-directory variable is not set correctly

I'm using Emacs on Windows. I also have a VirtualBox VM that I connect to using plink. But then, when I use the eshell, and I do cd <some folder> it tells me No such directory found via CDPATH ...
9
votes
1answer
3k views

How do I make tramp+eshell use my environment customized in the remote ~/.bash_profile

I have set up custom $PATH in my ~/.bash_profile on a remote machine (for programs installed user-locally by nix and cabal). I use eshell and tramp to issue commands on the remote machine (cd /...
12
votes
3answers
5k views

Reload environment variables

This question has been asked at superuser is-there-a-way-to-reload-environment-variables-in-emacs, but no good solution was given. I am using EmacsClient with often more than 30 buffers open, if I ...