Skip to main content
Share Your Experience: Take the 2024 Developer Survey
48 votes
Accepted

Weird shell output when using IPython 5

IPython 5 has a new terminal interface, which is not compatible with Emacs' inferior shells. To fix it, add the --simple-prompt flag to the IPython command: (setq python-shell-interpreter "ipython" ...
Ricardo Lima's user avatar
20 votes

How to clear the eshell

Running clear with 1, as in clear 1 works. How could you have found this out? We know we want to look for a function about eshell and it has to do with clear. So, why not do C-h f and type eshell ...
scribe's user avatar
  • 1,035
14 votes

Emacs can't find Node when Node was installed using NVM

Best solution: Install exec-path-from-shell. From the documentation, after calling (package-initialize), add the following to your .emacs file: (when (memq window-system '(mac ns x)) (exec-path-...
user2245766's user avatar
14 votes

fix or workaround: "Terminal is not fully functional"

Quick answer That's not an issue, it's a statement of fact. M-x shell isn't a fully functional terminal - it simply can't do what you want it to do. If you want a full terminal emulator in emacs, you ...
Tyler's user avatar
  • 22.3k
12 votes
Accepted

How can I setup eshell to use ivy for tab completion?

This should work fine: (define-key eshell-mode-map (kbd "<tab>") 'completion-at-point) I don't know why the above isn't the default. But I use only shell-mode and term-mode anyway.
abo-abo's user avatar
  • 14.1k
10 votes

Is there a way to view the man pages in color in emacs?

Add the follows to your init file and use M-x man or the man command in eshell to view man pages: (the colors fits the wombat theme; you can change them for yourself) (require 'man) (set-face-...
xuhdev's user avatar
  • 1,921
7 votes

How to let eshell remember sudo password for two minutes?

To get sudo working in Emacs 26 (probably the same for Emacs 25) without making an alias I had to add eshell-tramp to eshell-modules-list. (add-to-list 'eshell-modules-list 'eshell-tramp)
Emiluren's user avatar
6 votes
Accepted

Why is the 'type'-command not accepted in Eshell?

When it gives an error code, then the command will be passed to the real shell No, eshell is the "real shell". If there no such internal command, then eshell will look for an external command of the ...
npostavs's user avatar
  • 9,203
6 votes

How can I setup eshell to use ivy for tab completion?

I found something that seems to work OK upon initial testing: essentially rebind <tab> to pcomplete-std-complete, but since that function isn't interactive for some reason, you need to wrap it: ...
Omar's user avatar
  • 4,832
6 votes
Accepted

No colors for eshell?

Eshell is an independent command interpreter implemented in Elisp, so by default it should have nothing to do with your other dotfiles, such as ~/.bashrc. The custom prompt function you list works ...
Basil's user avatar
  • 12.4k
6 votes

fix or workaround: "Terminal is not fully functional"

If you don't care about whether Emacs is a "fully-functional" terminal or not and you just want it to work without making you press enter, then run the psql command \pset pager off. This ...
db48x's user avatar
  • 18.2k
6 votes
Accepted

eshell should use bash_aliases

eshell should not use your bash aliases because, other than them both being shells, eshell has nothing to do with bash. eshell is a shell written entirely in elisp. It's not bash, sh, ksh, csh, zsh, ...
phils's user avatar
  • 51.5k
5 votes
Accepted

emacsclient directly start eshell command command line

Surprisingly (at least to me), the -f flag means different things to emacs and emacsclient. To emacs, it means: -f FUNCTION --funcall=FUNCTION Call Lisp function FUNCTION. If it is an ...
Tyler's user avatar
  • 22.3k
5 votes

How to clear the eshell

This does it to one, insted of two lines. ;Clear the eshell buffer. (defun eshell/clear () (let ((eshell-buffer-maximum-lines 0)) (eshell-truncate-buffer))) Typing clear in eshell will then ...
K.D.G's user avatar
  • 51
5 votes

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

Like Mark said, Terminal and iTerm 2 invoke shells as login shells by default, so that Bash reads ~/.bash_profile but not ~/.bashrc, but M-x shell and M-x term invoke shells as non-login shells, so ...
nisetama's user avatar
  • 251
5 votes
Accepted

Can Emacs Eshell show remote man pages in TRAMP mode?

I have found a work-around! Admittedly it is a bit hacky, and uses woman rather than man, but I think this might just work for me. Essentially, woman-find-file is tramp aware, so if we can pass it the ...
Stig Brautaset's user avatar
5 votes
Accepted

How to mix eshell and elisp code

For something simple, shell-command-to-string may suffice. For something more complicated where the output needs to be modified, searched, etc., then something more elaborate may needed e.g., set-...
lawlist's user avatar
  • 19.2k
5 votes
Accepted

Setting E-Shell Alias

At first a comment on your alias. While the emacswiki-page suggests that alias mv 'mv -v $*' is right the corresponding official manual page says that you should use alias mv mv -v instead. In the ...
Tobias's user avatar
  • 33.2k
5 votes

Customize eshell redirection to buffer

To redirect to a buffer, use #<buffer buffer-name>, since Emacs 24.4, you can also use the shorthand #<buffer-name>. For example, echo hello >>> #<buffer *scratch*> echo ...
xuchunyang's user avatar
  • 14.6k
5 votes
Accepted

eshell print time and exit status for every command

Here is my attempt (defvar-local eshell-current-command-start-time nil) (defun eshell-current-command-start () (setq eshell-current-command-start-time (current-time))) (defun eshell-current-...
xuchunyang's user avatar
  • 14.6k
5 votes
Accepted

grep -l: Shouldn't I be able to load the files?

I don't think anything is broken, it seems that Emacs isn't designed to deal with the -l grep flag the way you're trying to use it. Without the -l flag, Emacs (via eshell or M-x grep) will take the ...
Tyler's user avatar
  • 22.3k
5 votes
Accepted

How to redirect output from eshell to any open buffer in Emacs?

Yes: ls >(get-buffer "*scratch*") Or even ls > #<buffer *scratch*> See this question for more details.
Fran Burstall's user avatar
5 votes
Accepted

how to do command substitution in eshell generally (NOT just for loop)

I then tried various sorts of C-h and websearch, without success. Please check the manual first! (or second, after docstrings) (eshell) Dollars Expansion: Eshell has different ‘$’ expansion syntax ...
npostavs's user avatar
  • 9,203
4 votes
Accepted

Possible to use grep in eshell without opening a *grep* buffer?

In Eshell, grep is a built-in command, which is a lisp function and works like Emacs's M-x grep. To use the external grep command, you need to use *grep instead. If you want to type just grep , you ...
xuchunyang's user avatar
  • 14.6k
4 votes
Accepted

Removing eshell automatic correction

The problem is not Eshell, but company-mode (maybe autocomplete-mode as well, I'm not sure). Try turning company-mode off and see if entering an asterisk (*) still has the same behavior. This issue ...
Tianxiang Xiong's user avatar
4 votes
Accepted

Is there a mode-hook when you switch to a buffer in Eshell mode

There is no hook specifically for switching buffers, but you can use the buffer-list-update-hook. Switching buffers re-orders the buffer list and triggers this hook, so you could use that to run a ...
glucas's user avatar
  • 20.6k
4 votes

Command to Run (Eval) "Hello World" in ELISP on Eshell?

The one word you request can also be just a dot .. After running that command you get: ~/Documents $ . hello.el Hello World ~/Documents $ If this is too strange for you you can also use: ~/...
Tobias's user avatar
  • 33.2k
4 votes

How to force new `shell` to appear in current window?

Here's what I have for this. It opens a shell in the current window. (add-to-list 'display-buffer-alist '("^\\*shell\\*$" . (display-buffer-same-window)))
Chris McMahan's user avatar
4 votes
Accepted

How to keep grep results in eshell buffer

eshell has several built-in commands (grep among them) and it prefers to use the built-in version: ~ $ which grep eshell/grep is a compiled Lisp function in ‘em-unix.el’. As the manual that I linked ...
NickD's user avatar
  • 30.5k
4 votes
Accepted

Why does `eshell` not create an active process In Emacs while `shell` and `term` do?

As mentioned in the manual page on Processes, the term process refers to an OS process. Emacs runs in a process, but can invoke other external processes and manage them as subprocesses. When you run M-...
Trevor's user avatar
  • 56

Only top scored, non community-wiki answers of a minimum length are eligible