Live data from Hacker News

Eschewing Zshell for Emacs Shell (2014)

howardism.org

21–26 of 26 posts

Re: Eschewing Zshell for Emacs Shell (2014)

#21
post #4

I tried using shell mode in emacs, but my fingers use control-p and control-r on the terminal shell and I fail. instead of searching backwards in commands, it does it in the buffer. How do people deal with this?

i also thought i can't get used to it, but i can!

otherwise, as others have mentioned it, remap the keys!

also, you can talk to some LLM about it, if you feel it would be tedious to come up with better bindings.

feed in the key bindings from `C-h m` of eshell, enumerate which bindings you want to carry over from traditional shells and instruct it to recommend you binding swapping pairs.

i was able to get great results on such niche operations already from anthropic's opus 4.5 models but even grok or deepseek was pretty helpful already last summer.

steve yegge's efrit takes this to a whole new level, by letting the LLM interrogate your running Emacs process live for documentation or function source code:

https://github.com/steveyegge/efrit

he demoed it here:

https://youtu.be/ZJUyVVFOXOc?t=246

Re: Eschewing Zshell for Emacs Shell (2014)

#22
post #14

> with EShell, you don’t need to bother with a pager, since if you received too much information, hit C-c C-p which jumps you to the top of the last command, and then C-v your way down. Or better yet, just search for what you want. Cmd+Up - jumps you to the top of the last command Cmd+F - just search for what you want I don't need no stinkin' Emacs

Does the Mac terminal keep infinite lines? That's one place where Emacs shines. It just keeps EVERYTHING, other terminal emulators only keep like the last 10,000 or so which is really easy to hit if you cat too big a file.

it’s a setting you can enable, just like with most terms on linux

Re: Eschewing Zshell for Emacs Shell (2014)

#23
post #2

Personally, while living in Emacs (EXWM), I still can't live on eshell, the issue is "the terminal", too many commands are simply uncomfortable to use in eshell while run smoothly in a real terminal. I've also tried some new shells, the one I last more is xonsh, but generally I came back to zsh even if I use in general much less the shell than before thanks to Emacs, the 2D shell. Emacs completion also it's very nice…

i second the eat package recommendation.

there are some quirks with it though, given it has a couple of input modes.

i think everyone should read its fantastic documentation 1st to avoid frustration, instead of just falling back to the local minima of trying to use their pimped up shell inside eat as is.

e.g. i had a 2 line starship prompt enabled in my macOS zsh and inside eat it made the screen scroll back and forth by half a page randomly as i was just typing regular characters at the prompt.

M-/ moves the Emacs point in semi-char mode, but the underlying shell is not aware of it, so the next character input will happen at an incorrect position. M-f/b works though.

There is an auto-line-mode, which might be a good compromise, but i haven't tried it yet.

Re: Eschewing Zshell for Emacs Shell (2014)

#24
post #4

I tried using shell mode in emacs, but my fingers use control-p and control-r on the terminal shell and I fail. instead of searching backwards in commands, it does it in the buffer. How do people deal with this?

a good reason for getting used to the M-n/p/r binding is that they work in the minibuffer too, even in `emacs -Q` (though without live feedback, but i think that's a fine compromise)

for the past half year i'm using emacs without any extra competition packages and it's surprisingly usable as-is.

i haven't even customized the completion styles and it's fine!

i got used to typing `M-x -forward` if i want to find a command which contains the word "forward" and not just starts with it.

i do have karabiner elements remapping my keys under macOS and i use a tweaked version of @jeebak 's SpaceFn layout, where i've mapped Opt on holding the semicolon key, which still acts as semicolon, when tapped.

that way M-r is pretty convenient to type. M-p is less so though, because i switch to the regular opt key for that... i should really have to get used to my glove80 keyboard to avoid such quirks...

Re: Eschewing Zshell for Emacs Shell (2014)

#25
post #3
post #2

Personally, while living in Emacs (EXWM), I still can't live on eshell, the issue is "the terminal", too many commands are simply uncomfortable to use in eshell while run smoothly in a real terminal. I've also tried some new shells, the one I last more is xonsh, but generally I came back to zsh even if I use in general much less the shell than before thanks to Emacs, the 2D shell. Emacs completion also it's very nice…

I agree with the assessment about eshell. I use eshell for one thing only—quick terminal sessions in the same directory as the file I'm editing.

[deleted]

Re: Eschewing Zshell for Emacs Shell (2014)

#26
post #4

I tried using shell mode in emacs, but my fingers use control-p and control-r on the terminal shell and I fail. instead of searching backwards in commands, it does it in the buffer. How do people deal with this?

I'm surprised no one has yet mentioned Eshell has a module built in for exactly what you want, you just need to `(push 'eshell-rebind eshell-modules-list)`. Now C-p, C-r, etc. work as you are used to.
Post reply on HN