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" ...
user avatar
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 ...
user avatar
  • 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.
user avatar
  • 3,876
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: $ ...
user avatar
  • 2,315
13 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 ...
user avatar
  • 20.9k
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 ...
user avatar
  • 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 ((...
user avatar
  • 5,206
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.
user avatar
  • 13.6k
11 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 ...
user avatar
  • 20.1k
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
user avatar
  • 4,440
9 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 ...
user avatar
  • 715
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 ...
user avatar
  • 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 (...
user avatar
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-...
user avatar
  • 20.9k
8 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-...
user avatar
  • 1,709
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 ...
user avatar
  • 13.5k
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-...
user avatar
  • 5,206
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" (...
user avatar
  • 2,549
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 ...
user avatar
  • 5,315
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 $ / / $
user avatar
  • 9,993
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 ...
user avatar
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.
user avatar
  • 6,484
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 ...
user avatar
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 ...
user avatar
  • 14.2k
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 ...
user avatar
  • 5,206
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 ...
user avatar
  • 13.5k
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 ...
user avatar
  • 8,783
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: ...
user avatar
  • 4,582
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 ...
user avatar
  • 11.3k
5 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)
user avatar

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