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 ...
15
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 ...
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-...
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.
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-...
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)
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
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
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 ...
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, ...
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 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
How to launch term at startup in Emacs?
Start with Eshell:
(setq initial-buffer-choice #'eshell)
Start with running Bash in Term:
(setq initial-buffer-choice (lambda () (term "bash")))
C-h v initial-buffer-choice
If the value is a ...
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 ...
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:
~/...
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)))
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 ...
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-...
4
votes
Accepted
How to make buffer recognize file moved?
I could be wrong - if so, someone will correct me. But I think this is the case:
How can you expect Emacs to know where the file it read was moved to, if you move it outside Emacs? Same thing for if ...
3
votes
Accepted
eshell goes to the bottom of the page after executing a command
You can disable the Eshell's scroll feature using:
(add-hook 'eshell-mode-hook
(defun chunyang-eshell-mode-setup ()
(remove-hook 'eshell-output-filter-functions
...
3
votes
eshell goes to the bottom of the page after executing a command
You might check whether eshell-scroll-to-bottom-on-output is set to nil. Here's the documentation:
Documentation:
Controls whether interpreter output causes window to scroll.
If nil, then do ...
3
votes
Define custom keys only for eshell
(add-hook 'eshell-mode-hook
(lambda ()
(define-key eshell-mode-map (kbd "<f9>") #'emacs-version)))
3
votes
How to clear the eshell
While there is a built-in eshell/clear in recent versions of Emacs, it does something rather unfortunate: when there is unsent input at the current prompt, clearing the buffer sends the input. This ...
3
votes
How to clear the eshell
I use make eshell buffers and I rename them accordingly. So a slight modification to @scribe's answer works perfectly on eshell buffers with anyname.
(defun run-this-in-eshell (cmd)
"Runs the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
eshell × 226shell × 30
term × 16
tramp × 15
microsoft-windows × 9
ssh × 9
shell-command × 7
key-bindings × 6
ansi-term × 6
bash × 6
comint × 6
aliases × 6
osx × 5
terminal-emacs × 5
colors × 5
process × 5
environment × 5
path × 5
buffers × 4
window × 4
subprocess × 4
org-mode × 3
spacemacs × 3
init-file × 3
python × 3