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"
...
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 ...
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 ...
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.
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-...
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-...
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 ...
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)
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 ...
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 ...
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 ...
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 ...
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:
...
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 ...
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 ...
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 ...
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-...
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 ...
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 ...
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-...
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 ...
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-...
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 ...
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 ...
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-...
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 ...
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.
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 ...
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, ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
eshell × 220shell × 29
term × 16
tramp × 14
microsoft-windows × 9
ssh × 8
shell-command × 7
key-bindings × 6
ansi-term × 6
bash × 6
comint × 6
aliases × 6
osx × 5
terminal-emacs × 5
process × 5
environment × 5
path × 5
buffers × 4
window × 4
colors × 4
subprocess × 4
org-mode × 3
spacemacs × 3
init-file × 3
python × 3