Hot answers tagged

47 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" ...
32 votes
Accepted

What are all the ways of launching a shell from inside emacs and what are their various properties?

M-x shell is the standard interface to OS's shell. On linux, it calls bash (or whatever your default), on Windows, it calls cmd.exe. M-x shell is the most frequently used. M-x eshell is a shell ...
  • 1,706
23 votes
Accepted

How to run a previous command in an Emacs shell?

The function that cycles backwards through input history, saving input. is comint-previous-input It is bound to C-up, M-p.
  • 3,976
15 votes

How to let eshell remember sudo password for two minutes?

First of all check which sudo is executed in your eshell session. It can be your system’s sudo: $ which sudo /path/to/system/wide/sudo $ which *sudo /path/to/system/wide/sudo or eshell’s sudo: $ ...
  • 2,325
14 votes
Accepted

How to programmatically execute a command in eshell?

My initial hunch was looking for an official command that does this already, so I've found eshell-command. However that outputs to a separate buffer, so it's not an option. Here's an example with ls ...
  • 21.2k
13 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 ...
  • 805
12 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 ...
  • 20.7k
11 votes
Accepted

Run application in cwd on remote host from within eshell

That looks like a bug in eshell, you should report it. I think you can fix it by (defadvice eshell-gather-process-output (before absolute-cmd (command args) act) (setq command (file-truename ...
  • 4,440
11 votes

How to clear the eshell

There is a function in the current development version, as you can see on the emacs-devel mailing list. The function is very simple: (defun eshell/clear () "Clear the eshell buffer." (let ((...
  • 5,236
11 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.
  • 13.6k
10 votes
Accepted

How to remove alias from the eshell?

The alias command of eshell can also be used to remove aliases: just leave out the definition part. $ alias hello
  • 4,440
9 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-...
  • 1,739
8 votes
Accepted

Configuration of eshell. Running programs from directories in PATH env variable

The Emacs equivalent of the PATH environment variable is exec-path, which is a list instead of a colon-separated string. Its content it initialized with the value of PATH, so supposedly it should be ...
  • 4,440
8 votes

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

This question has been already answered by rekado (thanks!) (as a reply to another more general question about eshell): You can configure TRAMP to respect the PATH variable on the remote machine (...
8 votes

How to open `shell` or `eshell` in a new window or frame

The canonical way of altering the display behaviour for a buffer is to customize display-buffer-alist: (setq display-buffer-alist '(("\\`\\*e?shell" display-buffer-pop-up-window))) (setq display-...
  • 21.2k
8 votes
Accepted

How to open files in eshell with wildcards

(defun eshell/my-find-file (pattern) (mapc #'find-file (mapcar #'expand-file-name pattern))) then use my-find-file **/Threshold.java from Eshell, if you also want my-find-file to support non-glob ...
  • 13.8k
7 votes

Configuration of eshell. Running programs from directories in PATH env variable

You can configure TRAMP to respect the PATH variable on the remote machine (for remote eshell sessions) by adding 'tramp-own-remote-path to the list 'tramp-remote-path: (add-to-list 'tramp-remote-...
  • 5,236
7 votes
Accepted

How to improve the performance of eshell buffer truncation?

Taking the suggestion from PythonNut and rekado, I have switched to truncating when idle, so my current solution looks like: (defun my/truncate-eshell-buffers () "Truncates all eshell buffers" (...
  • 2,599
7 votes
Accepted

Why Emacs overrides my PATH when it runs bash?

As Gilles mentioned in the comment above, emacs does not read the local env settings unless specifically asked to. The easiest way to keep variables in shell terminals inside and outside Emacs is to ...
  • 5,423
7 votes

Equivalent of `shopt -s autocd` in eshell

I hate to break this to you, but it's the built-in default behavior. :) Welcome to the Emacs shell ~/.emacs.d $ / / $
  • 10.1k
6 votes
Accepted

How to tell eshell to use the os-specific tools if available

If it's just for a single invocation then, as per the eshell manual (look for the "Built-in commands" section), you can prefix any command with '*' to ignore the built-ins: $ which ls eshell/ls is a ...
6 votes

How to run a previous command in an Emacs shell?

Just found an answer on Super User: How do you run the previous command in emacs shell? M-p goes to the previous command.
  • 6,644
6 votes
Accepted

How can I reclaim "nth" for bash in eshell?

You'll need to redefine the alias for eshell. For instance if you alias nth to echo hi in bash then in eshell type alias nth echo hi eshell will write your aliases to your eshell-alias-file where ...
6 votes
Accepted

Using virtualenvwrapper in Eshell

virtualenvwrapper (in melpa) gives the command venv-workon to switch environment, but for all emacs session too. It works with eshell with venv-initialize-eshell: support for eshell is turned on by ...
  • 1,051
6 votes

Display images in eshell with `iimage-mode`

Based on what happens behind the scenes when you call iimage-mode, you can define a function that takes care of displaying images for you, and have Emacs run this function every time you issue an echo ...
  • 14.3k
6 votes
Accepted

Is there something like brace expansion in eshell?

As far as I know there is no built-in support for brace expansion. You can, however, use plain elisp: ls -la (mapcar (lambda (x) (concat "prefix-" x ".suffix")) '("A" "B" "C")) This will run ls -la ...
  • 5,236
6 votes
Accepted

How to create back/forward directory aliases for eshell?

The following saves cd history and provides eshell commands b and f to navigate that history: ;;*--- track cd history ------------------------------------------------*/ (defvar-local eshell-hist-dirs ...
  • 13.8k
6 votes
Accepted

Merge history from multiple eshells

Disclaimer: I don't use eshell, so take this with a grain of salt. eshell appears to call eshell-write-history to write history, which takes an optional argument append which defaults to nil. This ...
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 ...
  • 8,853
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: ...
  • 4,632

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