
Eschewing Zshell for Emacs Shell - brudgers
http://www.howardism.org/Technical/Emacs/eshell-fun.html
======
rekado
Another thing that's really nice about Eshell is that it has TRAMP
integration. You can just `cat /ssh:remote:~/foo.log` and it will
transparently spawn an SSH session, run the command on the remote, and print
the output.

It's a little like translators on the Hurd.

I don't use Eshell that much anymore (I got used to `M-x shell`), but it
really is nice. The only drawback is that everything must go through Emacs
buffers, so in some cases performance isn't great.

~~~
throwaway91111
Err, i may be missing something, but you can do this with ssh anyway:

ssh host cat foo.log

~~~
mickeyp
Then here is a better example:

$ find-file /ssh:foo@example.com:/opt/myfile.txt

Emacs will open the remote file in a buffer local to your Emacs and you can
edit it as though it were a local file. When you save it's saved remotely,
etc.

~~~
rekado
Hey mickey, thanks for "Mastering Emacs"! I'm glad I bought it. I recommend it
to everyone having trouble making themselves comfortable in Emacs.

~~~
bjpbakker
Completely agree! It came out just after I decided to ditch vim and use emacs.
This book has helped me a whole lot with understanding emacs.

Thank you vey much for this book Mickey!

------
kozikow
I tried to give it a go once and I remember constantly hitting small problems
and after two days spent on fighting I went back to zsh.

The most annoying problem I couldn't find a solution for was lack of ability
to open majority of applications in terminal - e.g. postgress shell.

Solution I am using nowadays is:

1\. Zsh->Emacs shell macro to open file in emacs using emacsclient.

2\. Emacs->Zsh by emacs function generating "cd" command to the folder of
current file and adding it to my clipboard.

~~~
throwanem
If you add binaries like psql, that need to control the terminal, to `eshell-
visual-commands', Emacs will give them their own ansi-term buffers when you
start them in eshell. `eshell-visual-subcommands' does the same for e.g. git
log (but try Magit, too!)

------
teknico
Speaking of cross-platform alternatives to traditional Unix shells, if you
like Python try [http://xon.sh](http://xon.sh) . More compatible and overall
usable as a shell than IPython.

~~~
BeetleB
I use this both on my work machine (Windows) and on my Linux box.

On Windows, it's great - if you don't want to learn Powershell. I get bash
like behavior and can easily write custom "shell" scripts.

On Linux - not so great. Borderline frustrating to be honest. Some of the
issues I have:

If I open something using nano, pressing ^X doesn't work as expected. Similar
problems with other terminal software: I think some keybinding in less didn't
work as well.

Midnight commander takes a long time to load. Randomly, in Midnight commander
I cannot click on things.

Actually, this ability to click and select text in my console randomly goes
away with Xonsh. Sometimes it works, sometimes it doesn't.

A few other quirks I don't remember.

I tried different terminal software and the problems were in all of them.

I haven't yet reported these to the team. I do hope they can fix them. It is
otherwise a great shell.

~~~
atkailash
I have a couple similar ones too. Except I can't even start nano, it
automatically gets sighup or something I think.

------
gbrown_
Jokingly, why not just boot into Emacs?

[https://www.informatimago.com/linux/emacs-on-user-mode-
linux...](https://www.informatimago.com/linux/emacs-on-user-mode-linux.html)

~~~
microcolonel
I know somebody who does this unironically.

~~~
agumonkey
get him to do a screencast, or many screencasts.

------
Derbasti
Eshell was what brought me to Emacs in the first place, as it is a shell that
works the same way on Linux, macOS, and Windows, and thereby saved my sanity.

~~~
nothrabannosir
Do you mean, more than e.g. bash compiled for Windows? I used that (msys?)
bash for a few years on Windows and it was... well it was bash. It comes with
standard Git for Windows install.

Or is there more to it?

~~~
Derbasti
Bash on Windows is like using a flightstick in a car. It sure works, but they
weren't built for each other. Eshell is just Emacs, and Emacs doesn't make
much of a difference between OSes.

The point is, Emacs comes with a lot of tools that would normally be
executables called by the shell (unavailable on Windows) and deals with paths
in a consistent way.

Besides, this was before git came with git bash on Windows.

------
topkekz
How come emacs shell still does not support input redirection? You have to do

    
    
        cat file | program
    

instead of

    
    
        program < file

------
codychan
There is something wrong with the `eshell/x` function, if start `Ctrl-!` in
_scratch_ buffer, after execute `x` in eshell prompt, there will `Wrong type
argument: integer-or-marker-p, nil x` in _scratch_ buffer; if I start `Ctrl-!`
in init.el, there will be `Marker points into wrong buffer: #<marker at 955 in
scratch> x` in my init.el file.

~~~
oskarth
This works for me:

    
    
      (defun eshell/x ()
          (interactive)
          (insert "exit")
          (eshell-send-input)
          (delete-window))

------
creese
I tried this for a couple of years but have since returned to iTerm/Bash. When
live tailing logs in production, the Emacs renderer is just too slow.

~~~
alasarmas
Have you tried auto-revert-tail-mode?

------
agumonkey
wonderful, eshell is a nice shellish emacs tool, makes me want to go further
but so far it's very potent as is. another johnw gem

------
TheGrassyKnoll
How does Eshell handle my Bash aliases & functions ?

~~~
oskarth
There's a slightly different syntax, but there are some hacks around this. See
[https://www.emacswiki.org/emacs/EshellAlias](https://www.emacswiki.org/emacs/EshellAlias)
for details

