-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
helix panics if started in non-existent dir #8068
Comments
I just don't see how this would work. If the cwd doesn't exists before helix is started then it's impossible for us ti the determine the cwd oath so all commands that use the cwd (:open, anytime you start an LSP, file picker, global search,...) just won't work properly. I think its entirely reasonable to assume that the cwd exists at startup. Especially because helix crashes immidietly (so no lost work) with an entirely reasonable error message I just don't think it's worth the extra headache to fix. |
I also recently experienced it, and even though I understood the message, it was not apparent what was wrong immediately since the shell did not give a similar error message (and my prompt includes the full CWD so even more "confusing"). So I think it might be good to at least adjust the error message to also include the path that it tried but does not exist? Or add a hint to the message that the user should check whether that directory exists/was removed by another process? |
I think the only other possible option is for helix to change to a different directory, when the cwd doesn't exist. But then you're left with the question of what directory should that be, and then the subsequent possible confusion from users when that happens. So the current behavior of refusing to start seems well justified. I think probably a lot of people have come to associate panic error messages with bugs, rightly or wrongly. Would you accept a PR that improves this message a bit? Something like:
|
Yeah I think helix should just print an error message and exit with an error code. |
Summary
helix panics if cwd is removed
Reproduction Steps
expected: no crash
actual: panics
#7185 says this is an internal invariant but in reality its used in many places accessible from the outside
Helix log
No response
Platform
linux
Terminal Emulator
weterm
Helix Version
helix 23.05 (c9694f6)
The text was updated successfully, but these errors were encountered: