reddit / emacs

How to make Eshell use vterm for visual commands?

varsderk · 2022-12-07 04:15
I am discovering the wonders of Eshell. I would like to use `vterm` rather than `term` for visual commands. (e.g. `top` etc.) Is there an easy way to configure this? Also: is there a way to use `completing-read` for searching history? I'd love to use all my nifty Vertico+Orderless config for that.
MitchellMarquez42 · 2022-12-07 04:54
There's a package called `eshell-vterm` that does exactly this.
varsderk · 2022-12-07 05:19
Perfect! Well, I was hoping I wouldn't have to pull in another package, but this one looks like it's pretty darn small. That'll do. (Other solutions welcome.) Do you know anything about searching history with `completing-read`?
varsderk · 2022-12-07 05:21
Never mind: `consult-history` does the trick. Daniel Mendler does it again.
emacsomancer · 2022-12-07 07:19
maybe also see: https://codeberg.org/akib/emacs-eat ("Emulate A Terminal, in a region, in a buffer and in Eshell")
deaddyfreddy · 2022-12-07 07:50
if you check the code for `eshell-exec-visual` - it's hardcoded to use `term-mode`, but I think you can advise or redefine the function to use `vterm-mode`. > top isn't `M-x proced` good enough?
deaddyfreddy · 2022-12-07 07:52
Sure, but `counsel-esh-history` has been there since 2016 :)
CorysInTheHouse69 · 2022-12-08 03:07
This requires counsel
deaddyfreddy · 2022-12-08 09:05
and `consult-history` requires `consult`
CorysInTheHouse69 · 2022-12-08 17:07
Counsel is a much larger package that consult is
deaddyfreddy · 2022-12-08 17:17
I don't know, how you measure that, but the LoC count is almost the same.
CorysInTheHouse69 · 2022-12-08 17:43
Counsel pulls in ivy and swiper as dependencies whereas consult has none. Ivy and swiper are decently large packages too
deaddyfreddy · 2022-12-08 18:33
> Counsel pulls in ivy and swiper as dependencies whereas consult has none. Doesn't matter, counsel itself is the same size as consult. And it's been there for years with all the features included, if it ain't broke, don't fix it. Unless you have a lot of time for tinkering.