sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
15.07k stars 341 forks source link

Immutable attribute handling #1170

Closed mskvsk closed 3 months ago

mskvsk commented 3 months ago

Please describe the problem you're trying to solve

Some files can have the immutable attribute.

Presently, if we try to rename or remove a file like this, nothing happens.

Would you be willing to contribute this feature?

Describe the solution you'd like

Ideally, Yazi should give an option to remove that attribute and go on with the operation.

Just notifying that that attribute is set would work too.

Additional context

Removing this attribute on Linux: sudo chattr -i filename

On Macos: sudo chflags nouchg filename

mskvsk commented 3 months ago

(I probably should have created this issue as a bug but not sure)

sxyazi commented 3 months ago

Can you provide more details please? e.g. the steps to reproduce?

sxyazi commented 3 months ago

If it's a bug, it's best to re-submit it as a bug report and fill out the template. This way, I can capture all the necessary information.

mskvsk commented 3 months ago

I wouldn't say it's exactly a bug, just an unhandled case.

Steps to reproduce:

  1. Create a file touch test
  2. Set the immutability attribute. Linux sudo chattr +i test, Macos sudo chflags uchg test
  3. Open Yazi and try to delete or rename the file

Behavior: Nothing happens

Expected behaviour: Show a warning/error to let the user know that it is impossible to delete that file due to the attribute being set. Ideally, give the user an option to remove the attribute and repeat the previous command.

sxyazi commented 3 months ago

I repeated your steps and observed:

  1. The progress bar turned from blue to red, indicating a task failure.
  2. I opened the task manager, pressed Enter to inspect the task, and got detailed reasons for the failure.

https://github.com/sxyazi/yazi/assets/17523360/f9bb2946-3d02-46ed-8c5d-ec63a0d7f77f

Closing as something did happen, and this is the expected behavior.

github-actions[bot] commented 2 months ago

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.