Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [eshell]

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

1
vote
2answers
42 views

Terminal (shell) side by side with editor, how to navigate back and forth?

I am new to Emacs. I can invoke a shell or eshell using M-x shell or M-x eshell. This created a shell and I can run executables from it. By default, this shell is in the same window as my source ...
0
votes
1answer
25 views

how to do command substitution in eshell generally (NOT just for loop)

How to do command substitution à la Bash in Eshell, and not just for loops? (Unfortunately, while this question asks my question, its answer only provides Eshell for-loop syntax. So please don't dupe ...
1
vote
1answer
55 views

How to store an eshell alias in `init.el`?

I like to keep my configuration as self-contained as possible, and I'm wondering whether there's a way to manage eshell aliases in my .emacs file. Is it possible to set up aliases with a function call ...
0
votes
2answers
61 views

pdb within eshell up/down keys dont work

I am running python3 in eshell. When I use import pdb; pdb.set_trace() in my code, pdb opens within eshell. Everything works in pdb but the up/down keys don't work for running the previous command. ...
0
votes
0answers
37 views

Why eshell lists my host environment variables when I am connected to other machine via ssh?

I am connected to another machine using tramp and my eshell does send all the commands to remote machine but when I do echo $PATH it prints me my local PATH. Why?
1
vote
1answer
76 views

How to execute external commands from an Eshell script

I would like to create an elisp function such as (defun script() (run "bash" "-c" "echo 1; sleep 3; echo 2") (eshell-print "Done")) From an Eshell, its execution should look like: eshell $ ...
0
votes
1answer
18 views

comint: show the original input when match-cycling through history

Currently, I have bindings for comint-previous-matching-input-from-input and comint-next-matching-input-from-input. My problem is this. Suppose I am on a prompt with some text (say, "x = ") and issue ...
0
votes
2answers
76 views

How to redirect output from eshell to any open buffer in Emacs?

I have my eshell opened in a window and in another window I have *Scratch* as a open buffer. I want to redirect the output of a command like say ls to *Scratch*. Is it possible? If yes, then how can I ...
3
votes
2answers
39 views

grep -l: Shouldn't I be able to load the files?

Example in eshell: $ cd ~/src/Sporth $ grep -rl Name * I get as output: -*- mode: grep; default-directory: "~/src/Sporth/" -*- Grep started at Fri Feb 1 17:07:41 grep -n -rl Name LICENSE Makefile ...
1
vote
2answers
33 views

eShell Aliases – How to `grep` Forward Slashes

In Bash, I have an alias of ls -Ap | grep --color=always /$ that grabs the directories of the current directory, more or less. That said, using the same as an alias in Emacs's eShell seems to not ...
0
votes
1answer
45 views

Cannot run entr from eshell

I'm running Spacemacs and have eshell enabled. I want to run the elixir tests every time I change any files in the directory. This is the command I'm running ls * | entr elixir bob_test.exs This ...
0
votes
1answer
49 views

How to interpolate current path in eshell

In eshell when I do $ echo "$(pwd)credentials.json" Directory /Users/gmauer/../credentials.json I get that Directory prefix. I'm assuming that it is because eshell reimplements pwd to return some ...
0
votes
1answer
49 views

Eshell command in another window keeping focus in the working one

Ho can I run an eshell command in another window keeping focus in the working one? Let's say I'm scanning a buffer searching for a regexp (to be precise an URL) and every time I find it I want to ...
1
vote
0answers
20 views

How to use separate versions of a language/runtime with two separate eshells?

I have two eshell buffers: esh1 and esh2. In esh1, I want to use a particular Node version, say 6.0.0. In esh2, I want to use a different Node version, say 8.0.0. Using a node version manager called ...
3
votes
1answer
167 views

How to force new `shell` to appear in current window?

Whenever I run M-x shell, a buffer appears almost randomly somewhere - splitting current windows as it sees fit. I cannot work out the logic behind it. The docstring says: (shell &optional ...
0
votes
1answer
38 views

eshell: Is there a built-in mechanism to permit an alias to process the ARGS?

I would like to set up a few straight alias (without fixed ARGS) for some external executables in Eshell that need access to the command-line ARGS (that will vary). The function eshell-maybe-replace-...
1
vote
1answer
37 views

eshell: How to create a git diff patch using the greater-than > symbol

Eshell does not seem to have built-in support for the greater-than symbol. How can I run the command: git diff SHA1234567890 > patch.diff I could run a separate shell command ... (start-process ...
1
vote
0answers
42 views

How to make eshell use zsh's zhistory?

I want to try eshell, but I heavily relay on the zsh's history commands, which is in ~/.zhistory. How can I let eshell read these commands?
3
votes
1answer
141 views

emacs start with eshell focused using .emacs config file

It's possible to start emacs with an eshell buffer focused using the -f flag as described in this question. > emacs -nw -f "eshell" I'm wondering if there's a way of launching eshell and focusing ...
1
vote
1answer
61 views

How to reverse eshell direction?

Ref: https://superuser.com/questions/209394/reversed-terminal-command-line-window How to solve that ^ problem for eshell? Such that, typing any command at the command prompt and pressing return, ...
2
votes
1answer
86 views

eshell print time and exit status for every command

fish shell (and zsh) let you register commands that run before and after every command. I have my shell configured to print the exit status if nonzero and the amount of time taken to execute the ...
-1
votes
1answer
39 views

Eshell - ./hello command not found(gcc)

emacs was installed by Msys32 on Win7 32bit! gcc can't run hello.c on eshell but on minibuffer, Why?
1
vote
1answer
103 views

Customize eshell redirection to buffer

In eshell I can redirect the output of a command (foo) to a buffer (bar) by inputting: foo > #<buffer bar> I want to customize this syntax the following way: foo > #bar Is it possible ...
0
votes
1answer
73 views

Eshell - confusion about weird order of evaluation in Haskell on Windows

I have wasted several hours trying to fix simple Haskell program where I tried to ask the user to enter a string and then display it. The program looks like that: main = do putStrLn "Enter ...
1
vote
1answer
75 views

Add to eshell-predicate-alist fails

I would like to add to the eshell-predicate-alist in my ~/.emacs.d/init.el file as described in https://www.masteringemacs.org/article/complete-guide-mastering-eshell and http://www.howardism.org/...
3
votes
0answers
438 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 ...
1
vote
0answers
35 views

How to set eshell's ls command to different program in different OS?

Since result of /usr/bin/ls is more neat compares with eshell/ls when filenames contain non-lattin Unicodes. I add an alias in ~/.emacs.d/eshell/alias, which makes eshell use /usr/bin/ls as default: ...
0
votes
1answer
260 views

Shell IO Behavior For Emacs' Shells

The GNU page for Eshell says that Eshell is not a replacement for system shells such as bash or zsh. Use Eshell when you want to move text between Emacs and external processes; if you only want to ...
1
vote
1answer
46 views

Eshell simple echo in parenthesis not working

Why doesn't the following work in eshell $ (echo "foo") Symbol's function definition is void: echo What I tried: googled eshell parenthesis not working More Context: Eventually I'm trying to ...
1
vote
1answer
617 views

setup shell to default eshell

I am new to Spacemacs and eshell. I try to open eshell via the default shortcut key SPC ' but it opens the bash shell: [wolfv@localhost ~] $ message "hello" bash: message: command not found... I ...
0
votes
0answers
353 views

Exec format error when trying to run scripts from eshell

i get the following error no matter which simple bash script i try to run emacs: /home/zeltak/bin/zbak.sh: Exec format error all the scripts work great from bash/zsh is this a known issue? cant you ...
0
votes
2answers
83 views

Emacs shell mode showing unwanted char

my emacs shell mode screen shot ... Normal shell looks like this... I have .emacs file empty.. emacs version 24.5.1 I already tried this https://stackoverflow.com/questions/20663005/why-does-...
2
votes
2answers
215 views

Running a command in term from eshell with arguments

Basically I want to run watch from eshell. Simply running watch date (for example) doesn't work (only the first header line is displayed). Apparently I should run it with term or ansi-term but these ...
1
vote
0answers
32 views

Does eshell support directory-stack expansion ala bash?

Does eshell support directory-stack expansion ala bash ? bash> pushd dir bash> ls ~-1 <Outputs contents of dir>
4
votes
1answer
204 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 ...
7
votes
1answer
304 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: ...
3
votes
1answer
81 views

Saving raw ANSI escape codes in M-x shell, M-x eshell, or M-x term

Each of M-x shell, M-x eshell, and M-x term in Emacs lets me save the buffer to a text file. But the terminal colors are not saved. How do I save the raw ANSI escape sequences too?
1
vote
1answer
91 views

Is there a way to use strings to name eshells

I know a numeric prefix will create (or switch to) a new eshell session with that number. Is there a way to assign a string instead of a number? For example, normally I get the following: *eshell*&...
0
votes
2answers
219 views

How to do 'Hello World' in Emacs-LISP on Eshell and display evaluation in shell area itself, instead of echo area or *message* Buffer?

I am new to Emacs and struggling to learn it. How to get rid of the line Emacs: command not found? ~/Documents $ eshell-source-file hello.el Emacs: command not found Hello World ~/...
4
votes
1answer
377 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 (...
2
votes
4answers
471 views

Command to Run (Eval) “Hello World” in ELISP on Eshell?

I am new to Emacs and ELISP A file (message "Hello World") saved as hello.el. Now, how to run (evaluate) this file on Eshell? ~/Documents $ ....... hello.el
1
vote
1answer
187 views

utf-8 characters with eshell, eshell-visual-subcommands, and git

Using the configuration (eval-after-load "em-term" '(progn (add-to-list 'eshell-visual-subcommands '("git" "diff" "help" "log" "show")) (add-to-list 'eshell-visual-options '("git" "--help"...
0
votes
2answers
137 views

How to exit Man mode - Why does this function break eshell/man-mode?

I can't seem to find the keybinding for closing a buffer after running man in eshell. C-h b doesn't help. Neither does killing a man buffer, because eshell is unresponsive afterwards. What am I ...
4
votes
1answer
201 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 ...
1
vote
1answer
233 views

Is there a mode-hook when you switch to a buffer in Eshell mode

For my function, that I have created, I'm looking for an Eshell mode hook. I'm aware of the following hook: (add-hook 'eshell-mode-hook 'my-function-for-eshell). But what when I'm in a other ...
1
vote
1answer
331 views

No colors for eshell?

I have the following in my code to customize eshell: (setq eshell-prompt-function (lambda nil (concat (propertize (eshell/pwd) 'face `(:foreground "blue")) (propertize " $ " 'face `(:...
4
votes
0answers
173 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 ...
1
vote
0answers
112 views

How to wait for command execution to complete in eshell

I guess I don't quite understand how to write commands for eshell. I am using the form: (defun eshell/command ()" " (interactive) (insert "command") (eshell-send-input)) When I do this it prints ...
1
vote
0answers
91 views

Wrong encoding in eshell when closing Emacs

I have a lot of filenames in Russian in my file system. Every time I close Emacs if I had eshell opened, it shows a *temp* buffer with a list of directories. And asks 2 questions: Select coding ...
1
vote
2answers
137 views

Eshell and Dired are unable to extract port number from authinfo file

My default-directory is: /ssh:lawlist@12.34.567.89#2222:/home3/lawlist My .authinfo file contains: machine 12.34.567.89 login lawlist password abcdefg The above-combination works just fine. ...