Closed andrewpeck closed 3 months ago
How about (nerd-icons-icon-for-dir (file-local-name "/sshx:cobweb:~/"))
?
file-local-name
is fast as well, no calls to tramp, but the behavior is different---
In the cond that sets the icon, with file-local-name
is just falls back to the default case (since file-remote-p now returns nil because sshx:cobweb:~/
has just become `~/', indistinguishable from a local path) and I get an icon that looks like a folder whereas before it would take the first clause of the cond show a different icon for remote directories.
Thank you.
Thanks so much for the prompt fix. It works great! :partying_face:
Hi-- I recently ran into issues with emacs hanging and traced it down to nerd-icons.el
The issue is with the call to
(expand-file-name dir)
when the dir is remote which I encountered e.g. with nerd icons in consultI reproduced this on vanilla emacs 28.3 and 29.1 with the only installed package being nerd icons running in batch mode:
This hangs for a very long time (~1 minute per call) if the remote host is not available, and even when it available it is very slow since it is opening an SSH connection to retrieve each icon.
I am working around this by just replacing
(expand-file-name dir)
with(if (file-remote-p dir) dir (expand-file-name dir))
but there is probably a better solution.Any thoughts?
Thank you,
Andrew