4 ms·
I'm also a a long time vi user. I can't say why you hadn't heard about Eshell. I can say that Emacs has several such shell/terminal things most with different a
by mftb 4y ago
I'm also a a long time vi user. I can't say why you hadn't heard about Eshell. I can say that Emacs has several such shell/terminal things most with different approaches.
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?
- sc4les 4y agovterm
- chriswarbo 4y agoOne major problem is Emacs's poor performance when lines get really long (e.g. 1 MB). That's rarely a problem when using Emacs as a text editor, but it can happen quite a lot when running shells. 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)
- hsbauauvhabzb 4y agoThanks, I’ve faced this issue but didn’t know about gnu fold.
- chriswarbo 4y agoBe aware that bash doesn't like being piped, and changes some of its behaviour. I work around that using expect: - Here's the script itself https://github.com/Warbo/warbo-utilities/blob/master/raw/wrappedShell 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/wrappedShell.expect 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/fold.c 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/wrappedShell.nix https://github.com/Warbo/warbo-utilities/blob/master/scripts...
- mark_h 4y agoThere was a recent (a couple of weeks ago) commit that claims to rectify the long lines performance issue, for what it's worth.
- jhoechtl 4y agoThat is really interesting. May you take the effort and identify the commit? EDIT: Nevermind, search to the rescue This might be the discussion: https://lists.gnu.org/archive/html/emacs-devel/2022-08/msg00483.html 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?id=a71c05b44de74fe16691f680df34c4534992e472 https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?... https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?id=94c10c426e305037126cf75cc5cf23c9f8df4664 https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?...
- mark_h 4y agoAlso this one I think: https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=616da8fa8efa9023f56fa731072d877e2150afbc https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=616da...
- jhoechtl 4y agoJust tried it out. For my personal workflow when working on overlong lines, the performance gain is HUGE! From unusable to actually decent. Not using find-file-literally and even syntax highlighting enabled.
- mark_h 4y agoThat's great to hear, thanks! I haven't tested it in anger yet, and I'm not going to pretend to understand the display-code changes.
- sceadu 4y agoFYI newer versions of emacs are supposed to handle long lines better
- comfypotato 4y agoemacs-libvterm is bundled in Doom I think. This is how (I think) I ended up hearing about it from a friend (I don't actually use Doom). It's great. It has a very intuitive resolution to the issue of processing emacs keystrokes vs. terminal input, and it has a "copy-mode" that lets you grab output from the terminal.