5

I have to launch almost any application by specifying the whole path which is annoying.

For example, git works fine, but lua does not. Both are installed in the same place:

$ which git
/usr/local/bin/git
$ which lua
/usr/local/bin/lua

How to make M-x shell behave like my standard shell? Or maybe there's a decent shell emulator as a package?

echo $SHELL outputs /bin/bash.

itsjeyd
  • 14,586
  • 3
  • 58
  • 87
lukas.pukenis
  • 677
  • 6
  • 11
  • 1
    What are your shell and path variables? (Do `echo $SHELL` and `echo $PATH` in an emacs shell). – dshepherd Jun 02 '15 at 07:29
  • What about `term` or `eshell` ? – Scony Jun 02 '15 at 07:33
  • @dshepherd please see an update :) – lukas.pukenis Jun 02 '15 at 07:37
  • @Scony all of them do the same :/ – lukas.pukenis Jun 02 '15 at 07:38
  • 3
    Well, as @dshepherd mentioned, you are missing `/usr/local/bin` in `PATH`. `git` is working probably only because there is symlink in `/bin`. Try `export PATH=$PATH:/usr/local/bin` in emacs terminal. You can also check this out: http://stackoverflow.com/questions/8606954/path-and-exec-path-set-but-emacs-does-not-find-executable – Scony Jun 02 '15 at 07:41
  • Where does he say what his `$PATH` is? I can't see it! :( If an incorrect `PATH` is the problem then we might need to know more about how you are launching emacs (emacs will inherit `PATH` from wherever it is invoked). – dshepherd Jun 02 '15 at 07:47
  • @Scony your advice helped and fixed the issue. Please write an answer so I could accept it :) – lukas.pukenis Jun 02 '15 at 07:50

1 Answers1

9

Well, as @dshepherd mentioned, you are missing /usr/local/bin in PATH. git is working probably only because there is symlink in /bin. Try export PATH=$PATH:/usr/local/bin in emacs terminal.

You can also check this out: https://stackoverflow.com/questions/8606954/path-and-exec-path-set-but-emacs-does-not-find-executable

In the future, in case of similar issue, checking PATH (echo $PATH) should be first thing you should do.

Scony
  • 278
  • 2
  • 6