Questions tagged [eshell]
Eshell is a shell-like command interpreter implemented in Emacs Lisp.
221
questions
1
vote
0
answers
51
views
How to get tilde and plus working with the eshell's directory stack
In zsh, when one creates a directory stack with pushd, one is able to reference directories in the stack using a tilde followed by the numerical index of the respective directory in the stack. One ...
1
vote
0
answers
90
views
/bin/top not found in eshell over ssh
How does eshell resolve its PATH?
If I run my top in eshell on my local machine, it opens a new buffer and shows the output of the command in it. However, if I do the same on an eshell run on a remote ...
1
vote
1
answer
206
views
How to call Elisp functions from my own implementation of a shell?
I'm writing my own shell which can handle most of the GNU/Linux system calls now. So I was wondering if I could make this shell call Elisp functions too. Is it possible to do so? Is so, how do I get ...
1
vote
0
answers
594
views
Disable evil-mode in eshell
I have disabled evil-mode in eshell by (evil-set-initial-state 'eshell-mode 'emacs) but when I switch windows(accidentally) using C-w k from eshell, evil-mode gets enabled.
How do I prevent this ...
2
votes
2
answers
441
views
Is there a better way of writing this with use-package?
I feel like there is a better way of writing this with use-package but I just can't get the usual way to work.
(use-package eshell
:hook
(eshell-mode
. (lambda ()
(define-key
...
0
votes
1
answer
45
views
echo $(echo $HOM) in eshell of win10 platform get void function reported
I am working on emacs-27.1 of windows 10.
PS C:\Users\gaowei> emacs.exe --version
GNU Emacs 27.1
Within the eshell, I tried:
~/.doom.d [master] λ which echo
eshell/echo is a compiled Lisp function ...
0
votes
0
answers
186
views
is there a way to make compile shell process happen in eshell / "real" shell?
i wanted to bind a key to a compile and run command, then i found this post, Compile and run single file c++ programs in Emacs[SOLVED]
( last answer)
It works perfectly fine and as intended.
The only ...
0
votes
1
answer
142
views
How to use arrow keys to select a menu item from an emacs shell buffer
It is getting more and more common for clis to have little embedded menus (for example the Ionic cli does this, but so do many others) which you navigate with the arrow keys.
Please select the ...
4
votes
2
answers
289
views
How to keep grep results in eshell buffer
When entering the grep command in an eshell in spacemacs, a separate window and buffer are created to list the grep output results. However, I would prefer for the output to be listed in the eshell ...
0
votes
0
answers
137
views
Cannot run executable in eshell
I have an executable (guix) in directory under home. I am using eshell. I add that directory to PATH. But when I run the command, the executable is not found. I have tried various methods such as ...
0
votes
0
answers
255
views
Send command to run in eshell, after compiled
So I've been mapping my M-x compile like this, according to c-mode-hook or c++-mode-hook:
(add-hook 'c++-mode-hook
(lambda ()
(set (make-local-variable 'compile-command)
...
1
vote
1
answer
1k
views
Piping contents of buffer into eshell command
I know eshell supports output redirection to buffers
cmd > #<buffername>
Is there a way to do piping buffer contents into command? I would like to have something like
cat #<buffername&...
0
votes
1
answer
158
views
How to show colours and clear when running React development server in eshell?
Here is how the usual Ubuntu terminal looks when you run the React development serving using npm start and make changes to your source:
Say the server was already running and you tried to do npm ...
1
vote
1
answer
304
views
Eshell - enable type text in any place
Emacs 26.1, Windows 10 (64 bit)
M-x eshell
Here result:
But it's read only. But I need to type text in any place in any place in eshell.
Also I want to move cursor in any place in eshell buffer.
...
1
vote
1
answer
240
views
Error in custom eshell function (exit and close window)
I got the below function from an article on howardism.org. Its purpose is to exit eshell and close the corresponding window.
;; GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of ...
2
votes
1
answer
189
views
eshell grep thinks options are patterns on windows
I'm using Emacs on windows, and was trying to run grep from within eshell (M-x eshell). The default shell through M-x is cmd.exe, but eshell has linux utilities so I'm trying to use eshell.
Now, ...
2
votes
1
answer
332
views
Am I missing something on eshell piping to an elisp function?
I use emacs on a lot of different types of machines during the day, so I'm toying with writing some elisp scripts to avoid managing 4 scripting environments.
Specifically, I'm writing an elisp ...
2
votes
1
answer
440
views
How to launch term at startup in Emacs?
I need to have Emacs open a terminal at start-up automatically (in order to use Fish in the terminal and use Emacs to for example search the Fish output).
Normally I do this with 'M-x term'.
Is ...
2
votes
1
answer
537
views
How do I make file paths clickable/navigable in Shell as described in the documentation?
For the life of me, I cannot get this functionality to work:
https://wikemacs.org/wiki/Shell#Make_file_paths_clickable
I've run (add-hook 'shell-mode-hook 'compilation-shell-minor-mode) in my .emacs ...
1
vote
0
answers
257
views
Use Eshell with Tramp, from a Windows computer to a Linux server
I use a Windows computer to control servers through Tramp (with plink).
Here's my setup:
(setq explicit-shell-file-name "/bin/bash")
(setq default-directory "/plink:user@server:~")
Now when I run M-...
1
vote
1
answer
305
views
Missing color support (for exa) in eshell
I just started using eshell. But the color support for some commands seems to be missing. For example I like to use the command exa, because of its nice colors. But in eshell it is all black.
1
vote
2
answers
1k
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 ...
1
vote
1
answer
357
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 ...
2
votes
2
answers
1k
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
3
answers
721
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
0
answers
204
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
2
answers
1k
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
1
answer
81
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 ...
1
vote
2
answers
2k
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
2
answers
146
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
2
answers
257
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 ...
1
vote
1
answer
354
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
1
answer
288
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
1
answer
183
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
0
answers
33
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 ...
5
votes
1
answer
1k
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 BUFFER)...
0
votes
1
answer
205
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
1
answer
77
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
0
answers
86
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
1
answer
693
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
1
answer
121
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, ...
4
votes
1
answer
423
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
1
answer
114
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
2
answers
687
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
1
answer
108
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
1
answer
109
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/...
4
votes
1
answer
1k
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
0
answers
70
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
1
answer
581
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 ...
7
votes
5
answers
6k
views
fix or workaround: "Terminal is not fully functional"
What can I do about this issue? I'm using
psql, inside a ssh tunnel to ubuntu, inside a M-x shell, inside a emacsclient -nw