Skip to content
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

remove operation don't complete #246

Closed
oluceps opened this issue Oct 5, 2023 · 11 comments · Fixed by #161
Closed

remove operation don't complete #246

oluceps opened this issue Oct 5, 2023 · 11 comments · Fixed by #161

Comments

@oluceps
Copy link

oluceps commented Oct 5, 2023

Summary

According to the upstream issue Byron/trash-rs#57

In my case, removing file(s) from the top-level of $HOME to trash will get the schedule progress bar not moving on, and the operation not be successful as well. Caused by $HOME and trash bin not being in the same device.

This scenario is common in users who use tmpfs as root or bind mount their ~/.local to other devices.

# ~/.local/state/yazi/yazi.log

  2023-10-04T20:46:40.372878Z  INFO core::tasks::scheduler: Failed to work on task Trash(FileOpTrash { id: 5, target: "/home/elen/b", length: 0 }): Error during a `trash` operation: FileSystem { path: "/home/elen/.local/share/Trash/files/b.3", kind: CrossesDevices }
    at core/src/tasks/scheduler.rs:79

{
trash::delete(&task.target)?;
}

This will block the progress bar.

System: Linux 6.5.5

@sxyazi
Copy link
Owner

sxyazi commented Oct 6, 2023

What's your expected behavior?

@oluceps
Copy link
Author

oluceps commented Oct 6, 2023

What's your expected behavior?

Expect move file into trash.

@oluceps
Copy link
Author

oluceps commented Oct 6, 2023

What's your expected behavior?

Expect move file into trash.

Or give some hints on the interface about what happened, the progress bar is just stuck there when removing files. Even though the log recorded errors.

@sxyazi
Copy link
Owner

sxyazi commented Oct 6, 2023

I'm not sure how to fix it. Seems we can only wait for an upstream fix.

To my knowledge, for cross-device trashing, macOS creates a .Trash directory at the root of the device and simply moves files into it, while Windows permanently deletes files. I haven't observed the behavior on Linux yet. Is it more reasonable to keep the files on the current device or permanently delete them, rather than moving them to another device?

Regarding the UI, it's already included in the theme system. When a task fails, the progress bar changes color to red to alert the user.

@sxyazi sxyazi mentioned this issue Oct 8, 2023
8 tasks
@bassamsdata
Copy link

@sxyazi Thank you so much for the amazing work on this lovely file manager. It's really amazing file manager, and I use it daily but I noticed the below:

Since this is an open issue, I'd like to mention a similar bug:

Deletion with d

when deleting a file (or multiple files) with d it shows 0% 1 left even-though the file/files has been deleted and I emptied the trash bin. and even If I want to close yazi, it request me if I want to apport the process which of deletion, which already the files are deleted.

Note: this behaviour doesn't happen with D.

see below 2 screen shots.
here the statusline
Screen Shot 2023-10-09 at 7 45 37 PM
and here the task window and trash bin folder
Screen Shot 2023-10-09 at 7 46 08 PM

Case sensitivity in searching help

one small request please, if you can remove the letter case sensitivity when searching in help.

sessions or kind of persistant tabs

Are you planning on adding sessions or can I peresist specific tabs to be always there when I open yazi.
example: "if we can save session with 3 tabs and each tab in specific dir"
or "open yazi with 2 tabs, one of them is always in specific dir"

System info:

Terminal: kitty, xterm-kitty (and Alacritty)
MacOS 12.6
yazi 0.1.4

@sxyazi
Copy link
Owner

sxyazi commented Oct 10, 2023

Hi @bassamsdata

Deletion with d

Could you please paste the error logs here by pressing Enter in the trash task to "inspect" it?

BTW, a similar issue was fixed yesterday. Could you give the latest main branch a try to see if it works for you?

Case sensitivity in searching help

This should not be difficult to implement. Would you like to file an issue for it?

sessions or kind of persistant tabs

Nice to have, would you like to implement it as a plugin once the plugin system is available?

@bassamsdata
Copy link

Thank you for your prompt response @sxyazi

Could you please paste the error logs here by pressing Enter in the trash task to "inspect" it?

there is no error, just empty page of the terminal with flickery cursor, then I press q to close it that it. the delete heppened but the progress in the statusline persisted.

BTW, a similar issue was fixed yesterday. Could you give the latest main branch a try to see if it works for you?

I did brew install yazi --HEAD but it says this is up to date. then reinstall it but I noticed that I built the same version that I had before 0.1.4. but yay the issue has been solved.

This should not be difficult to implement. Would you like to file an issue for it?

yea sure. today, I'll do it.

Nice to have, would you like to implement it as a plugin once the plugin system is available?

I agree I think this should be as plugin. I'm sure someone would do it, unfortunately, I am not a rust programmer :(

One more question, are you planning to do undo for an action, like undo last deletion

(not the undo in the normal mode)

@sxyazi
Copy link
Owner

sxyazi commented Oct 11, 2023

@bassamsdata

there is no error, just empty page of the terminal with flickery cursor, then I press q to close it that it. the delete heppened but the progress in the statusline persisted.

I did brew install yazi --HEAD but it says this is up to date. then reinstall it but I noticed that I built the same version that I had before 0.1.4. but yay the issue has been solved.

Has this issue been resolved in the latest main branch for you?

I agree I think this should be as plugin. I'm sure someone would do it, unfortunately, I am not a rust programmer :(

No need for rust, just some lua :)

One more question, are you planning to do undo for an action, like undo last deletion

I'm not quite sure how to implement it. Yazi is using trash-rs, but it only provides a delete API, and not a restore one...

@bassamsdata
Copy link

Hey @sxyazi

Has this issue been resolved in the latest main branch for you?

Yes, it has been solved. Thanks 🙏

No need for rust, just some lua :)

This is would be amazing, I love lua :). people would create a lot of plugins with lua :)

I'm not quite sure how to implement it. Yazi is using trash-rs, but it only provides a delete API, and not a restore one...

I was thinking of different solution like persistant folder on the corner of yazi ui for trash bin folder, but I don't think this is a good idea.
so yea, then no need to undo delete :)

Copy link

I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 11, 2023
@sxyazi
Copy link
Owner

sxyazi commented Jan 16, 2024

Possibly related to your issue, #512

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants