Skip to content

Commit

Permalink
Docs: Add that the extract command requires 7z or 7zz
Browse files Browse the repository at this point in the history
  • Loading branch information
hankertrix committed Jan 4, 2025
1 parent 37740e6 commit 57b4f28
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ then it will operate on the selected items.
so this command is included in the
[augmented commands section](#augmented-commands) instead of the
[new commands section](#new-commands).
- This command requires the [`7z` or `7zz` command][7z-link] to
be present to extract the archives.
- You are not meant to use this command directly. However, you can do so
if you like, as the extract command is also augmented as stated in
[this section above][augment-section].
Expand Down

2 comments on commit 57b4f28

@xfzv
Copy link

@xfzv xfzv commented on 57b4f28 Jan 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance tar could be used for tarballs? That would fix sxyazi/yazi#1864

yazi maintainer said a new extraction tool (that would possibly address this) was planned, but we haven't had any news about it for months now.

Just curious if that's something you would consider adding with augment-command, maybe that's out of scope.

@hankertrix
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look into it, but it'll definitely make the code quite a lot more complex. There is also a good reason for not preserving permissions when extracting: the extracted files cannot automatically be run on your system when you extract an archive containing a malicious binary. It'll be something that you will have to opt into rather than being the default behaviour, maybe as a configuration in the setup function for the plugin. I personally do not use this feature as well, as most archives I deal with contain images or documents instead of executables.

So, no guarantees on this, but I'll look into tar and its flags and see if it is possible to have something sensible. I am also running short on time as the new year is starting and things are ramping up again. But my initial idea is to have a configuration option to keep permissions, and then use the tar extractor when the archive is a tar archive if this option is set and tar exists.

Regarding the new extraction tool built into yazi, I doubt that is coming any time soon. There is a massive amount of different archive file formats out there and the tool will need to be able to extract and decompress archives. This is not an easy task and even tools like 7zip don't support every archive file format that exists. It is a whole project on its own.

Please sign in to comment.