-
-
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
Panic if CWD gets deleted #2527
Comments
Agreed, this should call |
That's going to be a bit tricky, not everything has access to the Maybe it would be good to have a |
Also, it’s possible that the directory will only be gone for a given amount of time but then return. Use case: You have helix open at the node_modules folder in a project and you’re hacking some node modules in place to debug something. Then wipe the node_modules folder and do an npm install. (In fact, I’m not sure this is the right issue for this use case as it ties in more with helix not updating when source files update – something that has bitten me quite a few times, including while doing some live coding on stage at a conference…) |
fixed by #7185 but seems we forgot to close this |
Summary
If a document is being edited when the current working directory of helix has been deleted then helix will panic.
There's quite a lot of places where
std::env:current_dir()
just has an.expect()
on it so I'm opening the issue instead of going ahead and patch things up so we can agree on how this should be handled in general.Reproduction Steps
I tried this:
mkdir temp
touch myfile.txt
cd temp; hx myfile.txt
rm -rf temp
I expected this to happen:
Pop up that directory no longer exists or something sensible, but not a panic.
Instead, this happened:
Helix log
No response
Platform
Linux, FreeBSD, MacOS
Terminal Emulator
gnome-terminal, alacritty, iterm2
Helix Version
22.03-234-g8df8ff27
The text was updated successfully, but these errors were encountered: