MyGit

v0.4.0

sxyazi/yazi

版本发布时间: 2024-12-08 22:46:25

sxyazi/yazi最新发布版本:v0.4.2(2024-12-20 20:44:26)

This is the biggest release ever, with 53 new features, 41 fixes, and 12 performance optimizations.

The main focus of this release is improving the plugin system, and we’ve made some adjustments to certain APIs based on real-world usage to better support future extensibility. This release is a key step in moving the plugin system from BETA to stable!

This is a breaking change release, so please make sure to read: Migrating to Yazi v0.4.0

Spotter

https://github.com/sxyazi/yazi/pull/1802 introduces the concept of "spotter". When you "spot" a file, a popup will show up with metadata about that file.

For example, it can display the mime type and size of a regular file, the dimensions and color space of an image, the duration and resolution of a video, or the line count of a code file, etc.

You can easily copy this info with a simple keystroke or quickly swipe through files in the spot window.

What's even cooler is that users can set custom spotters for different file types, and plugin developers can use Lua APIs to build various spotters, just like with previewers!

https://github.com/user-attachments/assets/0e034f6b-f1ec-4e53-8701-57c6f8a218e3

Support for Transparent Image Preview

Transparent image previews are now supported in https://github.com/sxyazi/yazi/pull/1556 (Thanks to @diegodorado), and it works across all 4 image backends Yazi supports (kitty graphics-protocol, Inline images protocol, Sixel graphics format, Überzug++).

screenshot-002179

Auto Switch Between Dark and Light Icons/Flavors Based on Terminal Background

https://github.com/sxyazi/yazi/pull/1946 adds dark/light mode support — Yazi will automatically detect your terminal's color scheme and choose the appropriate icon color and flavor.

In theme.toml, the [flavor] section now includes two new attributes, dark and light, to allow setting different flavors for light and dark modes:

# theme.toml
[flavor]
dark  = "dracula"
light = "one-light"

New ya emit and ya emit-to Subcommands to Emit Commands to a Specific Instance

Two new subcommands, ya emit and ya emit-to, have been added to the ya CLI tool in https://github.com/sxyazi/yazi/pull/1946.

They allow you to send commands from outside Yazi (e.g., from your shell) to run on a specific Yazi instance for better interactivity.

The new ya emit subcommand allows users to send a command to the current Yazi instance. The format is:

ya emit <command> <args>

For example:

ya emit cd /tmp
ya emit reveal /tmp/foo

Just like you would write them in your keymap.toml file! You can also send commands to a specific remote instance using ya emit-to:

ya emit-to <receiver> <command> <args>

For example:

ya emit-to "$YAZI_ID" cd /tmp

Support Passing Arguments to Previewer/Preloader/Spotter/Fetcher

With https://github.com/sxyazi/yazi/pull/1979, you can now pass arguments to previewers, preloaders, spotters, and fetchers when configuring them:

# yazi.toml
[plugin]
prepend_previewers = [
  { mime = "image/*", run = 'my-plugin test --foo --bar=baz' }
]
prepend_preloaders = [
  { mime = "image/*", run = 'my-plugin test --foo --bar=baz' }
]
prepend_spotters = [
  { mime = "image/*", run = 'my-plugin test --foo --bar=baz' }
]
prepend_fetchers = [
  { id = "test", mime = "image/*", run = 'my-plugin test --foo --bar=baz' }
]

This makes them much more flexible, meaning the same plugin can behave differently based on different arguments, tailored to the user's preferences!

Suggest Keywords in the Header When a Finder Is Active

A new keyword indicator has been added to the header, in https://github.com/sxyazi/yazi/pull/1847, letting users know the current finding state with real-time feedback:

https://github.com/user-attachments/assets/3a1c5ada-db21-458f-996c-ebb8f6dba583

Allow Disabling Certain Preset Keybinds with the New noop Virtual Command

A new noop command has been introduced in https://github.com/sxyazi/yazi/pull/1882:

[[manager.prepend_keymap]]
on  = [ "g", "c" ]
run = "noop"

This allows users to disable specific default keybindings, and the disabled keys won’t appear in the "which key" component or the help menu.

Make the Built-in extract Plugin Support Compressed Tarballs (*.tar.gz, *.tar.bz2, etc.)

The built-in extract plugin now has experimental support for extracting compressed tarballs, making it more convenient for users who frequently work with .tar files.

Thanks to @DirkFi for his excellent work on https://github.com/sxyazi/yazi/pull/1583

Prioritize Paths That Need to Be Processed First During Bulk Renaming

The bulk renaming feature now has smart conflict resolution, done in https://github.com/sxyazi/yazi/pull/1801 (thanks to @yw1ee).

For example, if you’re renaming a list of files:

1
2
3

And renaming them to:

1 -> 2
2 -> 3
3 -> 4

Previously, Yazi would stop with an error when trying to rename 1 -> 2 because 2 already exists.

Now, it will intelligently pick files that won’t conflict and process them in order, so in this case, it will rename them like this:

3 -> 4
2 -> 3
1 -> 2

Fallback to CSI 16 t for Terminals That Don’t Support TIOCGWINSZ

All terminals on Windows (MS Terminal, WezTerm for Windows) do not support TIOCGWINSZ because Windows doesn't have ioctl.

Some terminals based on node-pty also don't support it (like Tabby, VSCode, Hyper, etc.).

https://github.com/sxyazi/yazi/pull/2004 falls back to CSI 16 t when TIOCGWINSZ is unavailable to provide better image size calculation for previews.

https://github.com/user-attachments/assets/50af66ef-40a8-46f0-b1c7-f09d2dd9fb9d

Launch From Preset Settings If the User’s Config Cannot Be Parsed

Now, if Yazi can’t parse your config file because of invalid values, it will ask if you want to launch with the default settings instead of failing to start.

This improves the user experience. Done in https://github.com/sxyazi/yazi/pull/1832

Other improvements

These are a few of my favorite features. For a complete list of improvements in Yazi 0.4, check out the full changelog below.

What's Changed

New Contributors

Full Changelog: https://github.com/sxyazi/yazi/compare/v0.3.3...v0.4.0

相关地址:原始地址 下载(tar) 下载(zip)

1、 yazi-aarch64-apple-darwin.zip 6.11MB

2、 yazi-aarch64-pc-windows-msvc.zip 6.14MB

3、 yazi-aarch64-unknown-linux-gnu.zip 6.74MB

4、 yazi-aarch64-unknown-linux-musl.zip 6.71MB

5、 yazi-x86_64-apple-darwin.zip 6.69MB

6、 yazi-x86_64-pc-windows-msvc.zip 6.57MB

7、 yazi-x86_64-unknown-linux-gnu.zip 7.19MB

8、 yazi-x86_64-unknown-linux-musl.zip 7.33MB

查看:2024-12-08发行的版本