-
Notifications
You must be signed in to change notification settings - Fork 386
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
Protection from copying a directory into itself #894
Comments
Hey, you can open the task manager by pressing the I don't think notifications are suitable for this scenario. For example, if a user copies 100 files and 30 of them fail, constantly popping up 30 notifications would be annoying. So I decided to just keep them in the task manager and use the red progress bar to quietly inform the user. Regarding adding protection checks, it would be nice to have and this would make nested copying/moving more secure. Anyone want to give it a try? I think yazi/yazi-scheduler/src/scheduler.rs Line 70 in e7dc971
yazi/yazi-scheduler/src/scheduler.rs Line 102 in e7dc971
|
@sxyazi There is already some similar code preventing the file to be copied/cut onto itself: yazi/yazi-core/src/tasks/file.rs Line 24 in e7dc971
Shouldn't the protection check be added there as well, so in that case it doesn't even reach the scheduler? Assuming you still want it to be in the scheduler, do you think that just checking and exiting earlier is enough? |
Hey @alexandruoprinca, this is different. When the user moves/copies However, the second image provided by OP is a process of |
I'm going to lock this issue because it has been closed for 30 days. ⏳ |
Please describe the problem you're trying to solve
cp has protection against copying a directory into itself.
This is not present in yazi resulting in an operation running forever.
Of course you could just quit yazi, so it is not an urgent feature, just a nice addition to yazi.
Would you be willing to contribute this feature?
Describe the solution you'd like
A warning message when you are about to copy a directory into itself.
Additional context
No response
The text was updated successfully, but these errors were encountered: