Questions tagged [eshell]

Eshell is a shell-like command interpreter implemented in Emacs Lisp.

Filter by
Sorted by
Tagged with
40
votes
3answers
8k views

Weird shell output when using IPython 5

I just upgraded to the latest version of IPython and now something is wrong when using it in emacs. When using it in a regular terminal it works fine (colors, tab-completion, etc.), however either ...
27
votes
1answer
724 views

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

I know of at least four possibilities: eshell term ansi-term shell What's the complete list of tools built-in to emacs to launch a shell, and what benefits and drawbacks do they offer?
16
votes
2answers
2k views

How to let eshell remember sudo password for two minutes?

In a general term runing bash, when I run a sudo ... command, bash will remember my password for a while. This makes package management task easier. For example: sudo apt-get update # password .........
16
votes
2answers
2k views

How can I setup eshell to use ivy for tab completion?

I'm very fond of ivy for completion and love that a simple (ivy-mode 1) is enough to get ivy almost everywhere that Emacs uses some sort of completion (that is acomplished by overriding completeing-...
12
votes
1answer
699 views

Run application in cwd on remote host from within eshell

I often use Eshell to connect to remote systems. On those remote systems I sometimes want to run scripts in the current working directory. In a regular terminal I'd type this: ./my-script.sh ...
11
votes
1answer
1k views

Attach to running remote shell with eshell/TRAMP/dtach

I often use GNU Screen to keep remote sessions alive. Since I live in Emacs, I'd really like to be able to resume a running remote shell session from within Emacs. GNU Screen implements all sorts of ...
10
votes
6answers
6k views

How to run a previous command in an Emacs shell?

Of course when I am in Terminal and I press the up arrow key, it goes to the previous command. However, when I hit the M-x keys and type shell an integrated shell comes up in Emacs: However, if I ...
10
votes
1answer
2k views

Colored git output in eshell

I'm using emacs inside a mintty (configured to say it's xterm-256color) terminal on cygwin. list-colors-display works fine. and colors are displayed in dired listings etc. Now I set the color for git ...
9
votes
1answer
2k views

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

I have set up custom $PATH in my ~/.bash_profile on a remote machine (for programs installed user-locally by nix and cabal). I use eshell and tramp to issue commands on the remote machine (cd /...
9
votes
1answer
154 views

How to create back/forward directory aliases for eshell?

For years I've been using a zsh script that causes a pushd to implicitly happen everytime you change directories. The script also sets up 'b' and 'f' aliases, short for backwards and forwards, that ...
9
votes
1answer
374 views

Merge history from multiple eshells

Before switching to eshell I had zsh setup so that it would: Write out to the history file after every command Append to rather than overwrite the history file so when running multiple shells they ...
8
votes
5answers
5k views

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

How can I configure eshell to be able to run programs from directories in PATH env variable? How can I add additional custom directories to the list? I use Emacs 24.3.1.
8
votes
3answers
372 views

How to open files in eshell with wildcards

I am very used to typing in a shell something like: emacsclient **/Threshold.java Where Threshold.java is a file deeply nested in a directory and I just want to open it by name. When I try the same ...
8
votes
3answers
3k views

How to programmatically execute a command in eshell?

I want to execute simple commands in eshell without explicitly typing them into the prompt, using something like with-current-buffer How can I do this?
8
votes
1answer
330 views

How to improve the performance of eshell buffer truncation?

I currently truncate buffers at 20,000 lines by adding the following to my configuration: (setq eshell-buffer-maximum-lines 20000) ;; automatically truncate buffer after output (add-to-list 'eshell-...
8
votes
2answers
786 views

Eshell: Go to prompt line on key press

Sometimes, when I scroll up in eshell, point leaves the command prompt line to stay in the visible area. When I then enter a command, I don't enter the command at the prompt, but rater insert the text ...
8
votes
1answer
162 views

Why does eshell prefer lisp functions even when eshell-prefer-lisp-functions is nil?

If I startup emacs 24.5.2 with emacs -Q and do M-x eshell, then run: $ which rm eshell/rm is a compiled Lisp function in `em-unix.el' I get the eshell version. But if I C-h v eshell-prefer-lisp-...
8
votes
1answer
648 views

Proper TERM type for eshell

Is there a way to make eshell behave better? By default printenv TERM returns dumb. For example brew often complains about the terminal type and causes eshell to "jiggle" while the progress bar is ...
7
votes
3answers
3k views

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

The terminal natively on Mac i.e. spawned through Spotlight or Launchpad, adopts the desired environment variables including the customization in ~/.bash_profile. But when I run Emacs (Emacs.app taken ...
7
votes
1answer
724 views

Is there a way to view the man pages in color in emacs?

I am trying to read the man pages in color. So far I have been using eshell and just typing man <program> However this does not use color to highlight the options etc. I have read that M-x ...
7
votes
2answers
1k views

Using virtualenvwrapper in Eshell

I noticed that I can't use virtualenvwrapper commands (like workon) in an eshell but they do work within a shell environment. Is there a virtualenvwrapper-like mode for Emacs?
7
votes
1answer
421 views

Setting E-Shell Alias

In my emacs alias file located at .emacs.d/eshell/alias, I have the following: alias mv mv -v $* Whenever I execute the alias in eshell, for example: mv from_here.txt to_here.text, I get the error: ...
7
votes
2answers
581 views

Why does xdg-open not work in eshell?

I want to open a.html in a browser from emacs (v. 24.5.1, using -Q [updated after comment]). M-x shell-command xdg-open a.html works as expected, but M-x eshell $ xdg-open a.html does not seem to ...
7
votes
1answer
487 views

eshell-visual-commands with tramp

I know that I can add commands to eshell-visual-commands to for example make it so when I run "top" it runs in a temporary ansi-term buffer instead of the eshell buffer, so that programs that rely on ...
6
votes
4answers
1k views

Display images in eshell with `iimage-mode`

My default shell is eshell. I just discovered iimage-mode that allows me to display images in buffers that contain some reference to an image file. Unfortunately, I doesn't seem to have any effect ...
6
votes
2answers
100 views

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

I understand why eshell provides elisp interpretations of the kill and rm commands, however, I would like Emacs to use the operating-specific implementations if they are available in the $PATH (...
6
votes
1answer
3k views

What does TERM=dumb in eshell mean?

In eshell, if I echo $TERM, the result is dumb. What does this mean? Is this an emacs specific thing, or a tty thing?
5
votes
5answers
4k views

How to clear the eshell

After looking at this answer I find it hard to believe there is no way to clear the eShell. Does anybody know of a short function or method to delete the entire buffer. Pressing C-l just scrolls the ...
5
votes
2answers
4k views

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

By M-x eshell or M-x shell Emacs opens a shell or an eshell in the current window. How to open this shell or eshell in a new window?
5
votes
2answers
618 views

How to remove alias from the eshell?

I recently created the alias in eshell: alias hello 'echo "Hello World"' So now whenever I type hello: I am very used to creating temporary alias in the Terminal for more subtle use. And then ...
5
votes
1answer
2k views

Why Emacs overrides my PATH when it runs bash?

Why do (shell-command-to-string "echo $PATH") and echo $PATH in eshell differ from echo $PATH from ansi-term and gnome terminal in Ubuntu? Some paths are missing from (shell-command-to-string "echo $...
5
votes
1answer
248 views

Is there something like brace expansion in eshell?

Is there something like brace expansion in bash or zsh for eshell? For those unfamiliar with brace expansion: it is a part of shell expansion in some shells, such as bash or zsh that works as follows:...
5
votes
1answer
224 views

Why does eshell corrupt my files when using redirection?

If I run this in bash (it's a GraphViz command to make a picture of a graph based on the input file testgraph): $ dot -Tpng testgraph.dot > graph.png with this testgraph.dot: digraph G { a -&...
5
votes
1answer
1k views

Eshell doesn't reuse TRAMP connection for remote subprocesses

I was trying to operate on remote host using eshell and was disappointed to discover that majority of operations would hang emacs for several seconds. I found it surprising considering that normally ...
5
votes
0answers
206 views

How to make eshell recognize path to files and make it clickable?

In the compilation environment in emacs (M-x compile), whenever there is a path to file (ex.: ../src/code.cpp:21:3: warning: comparison between...) it highlights the path and make it clickable. When ...
4
votes
2answers
786 views

eshell goes to the bottom of the page after executing a command

when I execute a command on eshell the prompt switches to the bottom of the window. I have to C-l a few times to get it back on top. Once again after I execute anything it goes back to the bottom of ...
4
votes
1answer
316 views

How to mix eshell and elisp code

If I'm in eshell I can run elisp commands cause I'm in an elisp runtime (mapcar (lambda (x) (* x 3)) (list 1 2 3)) (3 6 9) I can also run "shell" commands such as git status. But what if I wanted to ...
4
votes
2answers
586 views

What is the syntax for a subshell in eshell?

How to write the analogue of a bash-command like: (cd ../repo && git fast-export master) | darcs convert import repo_master in eshell? Here a subshell is employed to restrict the effect of ...
4
votes
1answer
355 views

Having trouble getting eshell remote shell multi-hop to work

I can get single hop ssh to work just fine: ~ $ cd /ssh:cpatti@wak-prod-jump1:~ /ssh:cpatti@wak-prod-jump1:/home/jumpboxaccess_emergency $ But when I try multi-hop, I get command not found every ...
4
votes
1answer
702 views

How to copy command output in ansi-term mode?

In ansi-term mode, is there a way to copy the command output? This is quite easy in eshell, but sometimes eshell behavors not exactly the same with bash. For example: eshell doesn't know how to auto-...
4
votes
1answer
313 views

How can I use 'emacsclient' as $PAGER in eshell with pipe? or any better PAGER which works well with eshell?

When I typed git diff in eshell, it has weird attribute such like print : in every single line, cannot scroll back, and so on. I think this is because the default eshell env PAGER is set as less, and ...
4
votes
1answer
98 views

remote tramp eshell session changes to localhost

I start a tramp dired session to a remote host with C-x d /ssh:user@host:/ and then start eshell with M-x eshell. This places me at the dired path on the remote host, however as soon as I try to cd ...
4
votes
1answer
594 views

Stripping stray ANSI escape sequences from eshell

I can't seem to identify this color sequence. I have enabled ansi colors successfully (to test, ls shows colored output), however a strange thing happens when I attempt to run npm and I can't identify ...
4
votes
1answer
478 views

Better aliases in eshell

I'm trying to translate some useful aliases from zsh to eshell (because ansi-term sucks). This is one such alias: alias l "ls -lAh $*" I want this to be able to receive any number of arguments (...
4
votes
0answers
809 views

Run interactive shell script in new buffer using elisp

I am looking for a way to display and interact with long running shell scripts in a separate buffer. While using eshell works, I'd like to automate most shell tasks using elisp. The best way I came ...
4
votes
1answer
263 views

(How) can I emulate {eshell,comint}-output-filter-functions in term?

What I want to do from inside a term shell is have a function called when there is new output or a certain regexp (e.g. a prompt) appears in in a term's output. The callback function should then be ...
4
votes
0answers
579 views

FZF broken displaying in emacs terminal

I'm struggling to run fzf in emacs but cannot figure out whats my problem. When I run fzf - and start typing - text gets mess up, similar to this: I tried run fzf in term, eshell, ansi-term, multi-...
4
votes
0answers
38 views

How do I prevent sed from endlessly reading stdin when run in eshell?

If you execute the following in bash: $ echo hello | sed 's/hello/world/g' world sed quits immediately, as desired. If you do the same in eshell, sed will still print 'world' but it will keep ...
3
votes
1answer
49 views

Why is the 'type'-command not accepted in Eshell?

As I understood from the documentation of Eshell, every time that a command will be executed, it will be executed internally in Eshell/Emacs. When it gives an error code, then the command will be ...
3
votes
1answer
74 views

How can I reclaim “nth” for bash in eshell?

In bash I commonly use an alias 'nth' (hint: it makes sense as a key-combo if you use Dvorak layout). When I type this in eshell, I see: ~ $ nth usage: nth: (N LIST) How can I get eshell ignore nth ...