Hot answers tagged

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
19 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
  • 980
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
  • 21.9k
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
  • 14k
11 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
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-...
xuhdev's user avatar
  • 1,859
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 ...
xuchunyang's user avatar
  • 14.4k
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
7 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 ...
J David Smith's user avatar
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 ...
xuchunyang's user avatar
  • 14.4k
6 votes
Accepted

Why does eshell corrupt my files when using redirection?

Redirection in Eshell works by writing the output of the command to a temporary buffer that's visiting the target file, then saving the buffer to the target file. By the way, “output” includes ...
Gilles 'SO- stop being evil''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,083
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,742
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.2k
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
  • 16.7k
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
Accepted

How to write a custom find-file function

You can use shell-command-to-string to get a shell command's output. From C-h f shell-command-to-string: shell-command-to-string is a compiled Lisp function in ‘simple.el’. (shell-command-to-...
xuchunyang's user avatar
  • 14.4k
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
  • 241
5 votes

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

I recently started using emacs outside of the terminal which was causing me some PATH issues. I had tried setting it by adding (getenv "PATH") to my exec-path, among other things that ultimately never ...
Steven's user avatar
  • 209
5 votes
Accepted

How do I protect command output in eshell and REPL buffers?

Modes that communicate with external shells should inherit from comint mode. eshell is an exception w.r.t this principle since it emulates almost all commands on elisp-base. First, setting output read-...
Tobias's user avatar
  • 32.8k
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
  • 21.9k
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
  • 18.9k
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
  • 32.8k
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.4k
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.4k
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
  • 21.9k
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,083
5 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
  • 49.6k
4 votes
Accepted

Why does xdg-open not work in eshell?

Set process-connection-type to nil. To be honest I don't understand why xdg-open doesn't work when that variable has the value t and I also can't remember how I learned that changing the value let me ...
Omar's user avatar
  • 4,742

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