News for hackers. Stuff that matters.
Re:Emacs: Mastering Eshell by chriswarbo on Wednesday August 17, 2022 @07:01PM (#32502902)
One 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)

Re:Emacs: Mastering Eshell by mark_h on Wednesday August 17, 2022 @07:32PM (#32503199)
There was a recent (a couple of weeks ago) commit that claims to rectify the long lines performance issue, for what it's worth.
Re:Emacs: Mastering Eshell by jhoechtl on Thursday August 18, 2022 @02:07AM (#32505887)
That 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/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?...

Re:Emacs: Mastering Eshell by mark_h on Thursday August 18, 2022 @03:29AM (#32506426)
Re:Emacs: Mastering Eshell by jhoechtl on Thursday August 18, 2022 @05:45AM (#32507303)
Just 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.
Re:Emacs: Mastering Eshell by mark_h on Thursday August 18, 2022 @06:38AM (#32507635)
That'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.
Re:Emacs: Mastering Eshell by sceadu on Thursday August 18, 2022 @09:26AM (#32509246)
FYI newer versions of emacs are supposed to handle long lines better
Re:Emacs: Mastering Eshell by hsbauauvhabzb on Wednesday August 17, 2022 @07:21PM (#32503098)
Thanks, I’ve faced this issue but didn’t know about gnu fold.
Re:Emacs: Mastering Eshell by chriswarbo on Wednesday August 17, 2022 @08:36PM (#32503733)
Be 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/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...