Emacs: Mastering Eshell
masteringemacs.org
masteringemacs.org
BTW, the author’s book Mastering Emacs is very good; I bought a license last month.
Somehow, over decades, I had never heard about this cross-platform shell built into emacs. There doesn't seem to be much fanfare about it (at least from an outsider's perspective), but having a consistent shell available on any platform emacs runs on is really cool.
My own most recent experience was I did a weekend experiment to switch over to Emacs. I've been trying to find more and more reasons to write various flavors of Lisp. My experiment was going well until I got to this part of Emacs. I realized a lot of my existing workflows depend on at some point bringing text into the editor, composing more text and sending it to the shell. From a programming perspective the different approaches I tried in Emacs (Eshell, dired and at least two more) seemed really cool, but the performance was unacceptable. I was left with blank screens, flashing cursors and scraps of text.
Does someone know is there one of the Emacs approaches to interacting with a shell or performing shell-like activities, that has dramatically better/native-like performance?
I've managed to avoid this by setting my shell to a script which pipes bash through GNU fold, so long lines are broken up before Emacs ever sees them (around 1000 characters; slightly earlier if there's whitespace). Rather extreme, but I really like shell-mode (not really a fan of eshell)
EDIT: Nevermind, search to the rescue
This might be the discussion: https://lists.gnu.org/archive/html/emacs-devel/2022-08/msg00...
These might be the commits: https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?...
https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?...
- Here's the script itself https://github.com/Warbo/warbo-utilities/blob/master/raw/wra...
- Here's the accompanying expect file https://github.com/Warbo/warbo-utilities/blob/master/raw/wra...
- Here's my patched version of GNU fold, which removes some buffering https://github.com/Warbo/warbo-utilities/blob/master/raw/fol...
- Here's the resulting Nix package (along with some tests) https://github.com/Warbo/warbo-utilities/blob/master/scripts...
I ended up getting setup really easily with Conjure[1]. It's a neovim plugin written in Fennel[2], a Lisp dialect that compiles to Lua. I'm writing my whole neovim configuration in lisp. It sounds like the setup to some emacs vs vim joke but it's actually pretty cool!
I have found it quite hard to explain others what exactly is great about eshell, because most people instinctively equate it with embedded terminals found in vscode etc. But it is really nice to have a shell where you can do most of the things you could in bash/zsh and also have complete programmatic access to the editor environment.
Anyways I don't really care for text editor wars or whatever. I just wanted to second this person's experience with vim -> emacs via Doom Emacs.
I do miss nvim's configuration in lua though.
I think there's two sides. The people who aren't familiar with Emacs will ask why should I care about this, and the people who are familiar with Emacs will most likely already know of the power that Emacs can bring and when faced with eshell for the first time just think "of course Emacs can do that, it's Emacs after all"
Inline images: https://xenodium.com/wizard-zines-comics-eshell-util
Snippet expansion: https://xenodium.com/yasnippet-in-emacs-eshell
Imenu: https://xenodium.com/imenu-on-emacs-eshell
Company completions: https://xenodium.com/eshell-pcomplete-company-completion
No worries, it’s a great article and I’m glad folks are reading it!
In the future we'll have some sort of karma sharing so earlier submitters get credit also.
Except there also seems to be an “LRU cache” to the dupe detector as well, so after some period of time stories aren’t considered duplicates at all. That is to say, that they are treated as evergreen.
Of course this is entirely speculative, but it is no longer like the hard dupe detection of the old days.
$ type type
type is a shell builtin $ type type
type: command not foundwell it’s GNU
it’s a parallel universe
it’s an OS
UNIX makes more sense, actually
I love emacs (and lisp) but I don’t like it