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

enter_archives doesn't behave like recent upstream yazi improvement #4

Closed
xfzv opened this issue Sep 28, 2024 · 3 comments
Closed

enter_archives doesn't behave like recent upstream yazi improvement #4

xfzv opened this issue Sep 28, 2024 · 3 comments

Comments

@xfzv
Copy link

xfzv commented Sep 28, 2024

% uname -s
Linux

% yazi -V
Yazi 0.3.3 (3e4973d 2024-09-28)

With the following in ~/.config/yazi/keymap.toml:

[[manager.prepend_keymap]]
on = ["<Right>"]
run = "plugin augment-command --args='enter --no-skip'"
desc = "Enter the child directory, or open the file"

[[manager.prepend_keymap]]
on = ["l"]
run = "plugin augment-command --args='enter --no-skip'"
desc = "Enter the child directory, or open the file"

Pressing either "<Right>" or "l" on a .tar.gz archive doesn't behave like pressing <Enter> (regular yazi extract).

extract has been improved lately:

Currently, augment-command creates the same duplicate directories that the old extract used to create before.

To reproduce (basically repeating steps in sxyazi/yazi#1548):

Using a recent yazi version containing sxyazi/yazi#1583

  1. Download a tar.gz archive
  2. Hover it and press <Enter>: a single directory named after the tar.gz archive is created, with the content in it
  3. Hover it and press "<Right>" or "l" with the configuration above: a .tar archive is created and hovered, then pressing "<Right> or "l" now hovers the directory named after the archive. Pressing "<Right>" or "l" again: the first file of the archive is finally hovered.

It would be nice if enter_archives could mimic the new behavior, i.e. directly extracting .tar.gz in a single directory and enter it.

@xfzv
Copy link
Author

xfzv commented Sep 29, 2024

Thank you for 2e64995, which is clearly an improvement.

A duplicate directory is still created compared to extract though. Using this tar.gz as an example, which contains a single directory mdcat-2.5.0-x86_64-unknown-linux-musl in it:

  • With yazi's extract
% lsd --tree mdcat-2.5.0-x86_64-unknown-linux-musl                                                             
 mdcat-2.5.0-x86_64-unknown-linux-musl
├──  CHANGELOG.md
├──  LICENSE
├──  mdcat
├──  mdcat.1
└──  README.md
  • With augment-command.yazi
% lsd --tree mdcat-2.5.0-x86_64-unknown-linux-musl
 mdcat-2.5.0-x86_64-unknown-linux-musl
└──  mdcat-2.5.0-x86_64-unknown-linux-musl
    ├──  CHANGELOG.md
    ├──  LICENSE
    ├──  mdcat
    ├──  mdcat.1
    └──  README.md

@xfzv
Copy link
Author

xfzv commented Sep 30, 2024

Can confirm eff8331 solves the duplicate directory. It now behaves exactly like yazis extract + entering the directory of course. Perfect!

Thanks.

@hankertrix
Copy link
Owner

Awesome! You're welcome!

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

No branches or pull requests

2 participants