-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't try to open non-regular files #10726
Comments
That seems mostly correct and match vim but symlinks should still be opened if they point qt a file or directory. Not sure how is_file handles those |
The weird thing is that not every method returning |
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. |
I believe this can be closed now since #10733 is merged. (Off-topic: Congratulations on Rustlings rewrite :)) |
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: