You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fs::metadata traverses symlinks so is_file would return true.
The weird thing is that not every method returning Metadata traverses symlinks. One needs to read its docs. For example, DirEntry::metadata does NOT traverse symlinks.
My first thought was "why?" but yeah, the more I think about it, apart from symlinks that point to regular files or directories, I can't think of a use case where any other file type makes sense. Editing a pipe, character device, block device, etc just doesn't make any sense. We need to be able to read the whole file and write back to it, and no other file type fits this pattern.
Summary
Helix should only open regular files. Non regular files like devices and pipes should be rejected.
This can be fixed by checking
FileType::is_file
.I can open a PR to fix it :)
Reproduction Steps
The following command will freeze and continuously eat RAM.
The following command just freezes:
Platform
Relevant on Unix but probably also on Windows
Helix Version
helix 24.3 (f656b4f)
The text was updated successfully, but these errors were encountered: