v0.3.2
sxyazi/yaziv0.3.2Aug 28, 2024by github-actions[bot]
AI Summary
Introduces a new 'confirm' component for safer file operations and word wrapping for code previews. Performance is optimized for image previews using a new 'image_delay' configuration option.
Key Highlights
- New 'confirm' component for safer and more efficient confirmations
- Word wrapping option in code previews
- New 'image_delay' configuration to reduce terminal lag during scrolling
New Features
- New 'confirm' component
- Word wrapping in preview
- image_delay configuration option
- --dir option for the create command
- ext() method for Url userdata
- Better handling of binary streams and invalid carriage returns
Full Release Notes
This version introduces two eagerly awaited new features: a brand-new `confirm` component, and word wrapping. ## Brand-new `confirm` component https://github.com/sxyazi/yazi/pull/1167 (thanks to @thelamb) introduces a brand-new `confirm` component that handles various confirmations (like trashing files, deleting files, overwriting files, and exit confirmations). The goal is to provide a safer and more efficient user experience: - **Safer**: Now, when you trash, delete, or overwrite files, it'll show a list of affected files for a second confirmation, instead of just the number of files like before. - **More efficient**: Confirmation now only requires pressing `Enter` once, instead of typing `"y"` and then pressing `Enter`. This should be a nice quality-of-life improvement. https://github.com/user-attachments/assets/51c5c533-06ab-4661-b9f9-fcdbe8b0324c ## Word wrapping https://github.com/sxyazi/yazi/pull/1159 (thanks to @mskvsk and @ArtyomArtamonov) adds a new `wrap` option under `[preview]`, which can be set to `"no"` or `"yes"`. When set to `"yes"`, word wrapping is enabled: ```toml # ~/.config/yazi/yazi.toml [preview] wrap = "yes" ``` ## Image preview performance optimization I've been working on optimizing Yazi's image preview speed, and with multi-threading, preloading, and a built-in image decoder, it should already be the fastest among all terminal file managers. However, I noticed some lag during fast scrolling and realized that at this point, the performance bottleneck isn't Yazi itself, but rather the terminal. When users scroll quickly, Yazi processes the images at a very high speed and sends them to the terminal, but the terminal can't keep up with processing them in time, which gives the impression of lag. In reality, it's not Yazi that's lagging, but the terminal. https://github.com/sxyazi/yazi/pull/1512 introduces a new `image_delay` configuration option to address this issue. When previewing images, it will wait at least `image_delay` milliseconds before starting to send the decoded image data to the terminal. This gives the terminal a breather and creates the perception that the file list is still scrolling smoothly. Additionally, this can reduce the CPU overhead caused by immediate image decoding during fast scrolling, thereby extending battery life. ### Before: https://github.com/user-attachments/assets/549fc6bb-3dbb-4f4f-ae61-1dd0fa9a88e8 ### Now: https://github.com/user-attachments/assets/17d5010c-eae2-4230-bc00-71945f22370b ## New `--dir` option for the `create` command The `create` command is designed to support creating both files and directories (with `/` or `\` at the end to indicate a directory). However, this isn't user-friendly for those who need to create many directories but few files, as they always have to type `/` or `\`. https://github.com/sxyazi/yazi/pull/1505 (thanks to @abstrakct) introduces a new `--dir` option that explicitly specifies creating directories without needing to type `/` or `\` every time. ## What's Changed * fix: overlong single-line text containing escape sequences was not being properly escaped by @sxyazi in https://github.com/sxyazi/yazi/pull/1497 * fix: upgrade `ansi-to-tui` to `5.0.0-rc.1` to resolve `ratatui` version conflict by @sxyazi in https://github.com/sxyazi/yazi/pull/1499 * feat: add `--dir` option to `create` command by @abstrakct in https://github.com/sxyazi/yazi/pull/1505 * feat: add `ext()` method to `Url` userdata by @sxyazi in https://github.com/sxyazi/yazi/pull/1528 * feat: new `confirm` component by @thelamb in https://github.com/sxyazi/yazi/pull/1167 * chore: set `MACOSX_DEPLOYMENT_TARGE` to 10.11 to make the binary compatible with old macOS by @hronro in https://github.com/sxyazi/yazi/pull/1532 * fix: use a different cache directory for each user to avoid permission issues by @sxyazi in https://github.com/sxyazi/yazi/pull/1541 * fix: wait till mimetype is resolved to avoid flickering by @sxyazi in https://github.com/sxyazi/yazi/pull/1542 * docs: add links to all terminal emulators by @nyurik in https://github.com/sxyazi/yazi/pull/1538 * feat: make the builtin `code` previewer handle invalid carriage return chars and binary streams better by @sxyazi in https://github.com/sxyazi/yazi/pull/1550 * perf: only scan the first 1024 bytes to detect if it's binary, apply `\r` fixes only to content within the visible range, avoid unnecessary allocations during natural sorting by @sxyazi in https://github.com/sxyazi/yazi/pull/1551 * feat: word wrapping in builtin code preview by @ArtyomArtamonov in https://github.com/sxyazi/yazi/pull/1159 * fix: filter out the `which` candidates that overlap with longer key chords by @sxyazi in https://github.com/sxyazi/yazi/pull/1562 * fix: `DECSET` and `DECRQM` tmux passthrough by @sxyazi in https://github.com/sxyazi/yazi/pull/1564 ## New Contributors * @abstrakct made their first contribution in https://github.com/sxyazi/yazi/pull/1505 * @hronro made their first contribution in https://github.com/sxyazi/yazi/pull/1532 * @nyurik made their first contribution in https://github.com/sxyazi/yazi/pull/1538 * @ArtyomArtamonov made their first contribution in https://github.com/sxyazi/yazi/pull/1159 **Full Changelog**: https://github.com/sxyazi/yazi/compare/v0.3.1...v0.3.2