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

Neither TIOCGWINSZ nor 14t allow introspection of the window size in pixels #8581

Open
csdvrx opened this issue Dec 14, 2020 · 16 comments
Open
Labels
Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Area-VT Virtual Terminal sequence support Issue-Scenario Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal.
Milestone

Comments

@csdvrx
Copy link

csdvrx commented Dec 14, 2020

Environment

Windows 10 Pro 20H2 (amd64)

Latest Windows Terminal Preview, running either msys2 or wsl

Steps to reproduce

compile and run the following code

#include <sys/ioctl.h>
#include <stdio.h>

int main (void)
{
    struct winsize ws;
    ioctl(1, TIOCGWINSZ, &ws);
    printf("rows: %d cols: %d xpixel: %d ypixel: %d\n", ws.ws_row, ws.ws_col, ws.ws_xpixel, ws.ws_ypixel);
}

Separately, send the xterm 14t sequence as documented in https://www.xfree86.org/current/ctlseqs.html :

 P s = 1 4 → Report xterm window in pixels as CSI 4 ; height ; width t

You can do that from a shell with:

echo -en "\033[14t\033\\"

Expected behavior

Both should work and return identical non 0 values

On mintty for example:

$ /d/wingetsize.exe
rows: 27 cols: 88 xpixel: 1056 ypixel: 729

This means the terminal is 729x1056

On wsltty running debian (WSL) for example:

$ echo -en "\033[14t\033\\"
^[[4;480;880t

This means the terminal is 880x480

Actual behavior

On a Windows Terminal running msys2:

$ /d/wingetsize.exe
rows: 25 cols: 98 xpixel: 0 ypixel: 0

The problem is not related to msys2 but purely Windows Terminal, as the above was obtained on a Windows Terminal running the exact same binaries and bash environment.

The absence of msys2 doesn't help: on a Windows Terminal running an official debian image (WSL) :

$ /mnt/d/wingetsize
rows: 21 cols: 84 xpixel: 0 ypixel: 0

To ignore any API issues, you can also try to send the specific xterm control sequence that should return the window size in pixels, and notice it returns nothing.

$ echo -en "\033[14t\033\\"

This properly returns the size on wsltty running debian-slim in WSL, so the problem is not related to WSL either:

wsltty-example

This issue may be related to #3718 (querying the colors via OSC) if you only consider the xterm control sequence. However the 0 values in TIOCGWINSZ is a tty ioctl, making this a wider problem, so I believe this is a separate issue.

At least one of these methods should work: introspection is required by some software to adjust their rendering to the actual space available on the terminal.

The absence of TIOCGWINSZ also impacts issue #448, as explained more precisely in #448 (comment) and illustrated in #448 (comment) : the screen size, along with the number of row and columns would allow inferring the font size, to avoid sixel images being stretched, squizzed, or a fraction of the correct size by sending them to the right size (in pixels) for their placeholder (in characters)

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Dec 14, 2020
@skyline75489
Copy link
Collaborator

Related: #5094

@DHowett
Copy link
Member

DHowett commented Dec 14, 2020

This is likely complicated by the fact that the Windows console subsystem does not and has never tried to support TTY IOCTLs. None of those requests ever reach Terminal because they’re shimmed out by whatever application compatibility layer you’re using to actually dispatch a TIOC... ioctl.

@csdvrx csdvrx closed this as completed Dec 15, 2020
@csdvrx csdvrx reopened this Dec 15, 2020
@csdvrx
Copy link
Author

csdvrx commented Dec 15, 2020

(oops, I accidentally hit Close instead of Comment, I'm not sure how to undo that, so I'm reopening the issue)

Related: #5094

@skyline75489 maybe exposing information to userland applications (as you must already keep track of the size of the window size somewhere :-) to let them adjust their behavior will be easier than controlling the terminal?

None of those requests ever reach Terminal because they’re shimmed out by whatever application compatibility layer you’re using

Then what about simply replying to OSC 14?

It's be nice to have TIOCGWINSZ , as several applications already use that (ex: tmux) but anything at all will be better than nothing :)

@skyline75489
Copy link
Collaborator

I think @j4james might have more insights on this one.

And It's CSI 14t, right? Not OSC.

@j4james
Copy link
Collaborator

j4james commented Dec 15, 2020

I don't think it's worth considering until we have a genuine use case for it. Right now we don't support Sixel, and if we did, our implementation would probably have to be independent of font size, so there's no value in reporting a window pixel size for that (other than maybe faking the values if that's necessary to make some apps work).

On top of that, it's not obvious to me what this sequence is even meant to report. I think it was originally defined as the window size, which some terminals interpret as the actual application window including chrome (i.e. title bar, borders, status bar, etc.), while others report some variation of the text area (although not necessarily the exact writeable area).

Then there's the issue of physical pixels vs density-independent pixels (i.e. on a high-dpi device with scaling). I would have thought DIP pixels made the most sense (otherwise how do you deal with a multi monitor setup with varying DPI), but most terminals I've been able to test seem to report physical pixels.

Another thing to bear in mind is that CSI t is also the DECSLPP sequence, so some terminals will simply interpret CSI 14 t as setting the screen height to 14 lines. That's admittedly rare - I think most that support DECSLPP only accept heights of 24 or more - but given the variability of the responses, even when supported, this doesn't seem like something you'd want to rely on.

It's also worth mentioning that TIOCGWINSZ has similar problems - in some cases it reports the windows size (i.e. including chrome), and some report the text area. In the few terminals I've found that supported both TIOCGWINSZ and CSI 14 t, most did not return the same values for them (although I haven't tested enough to suggest that that's typical behaviour).

@csdvrx
Copy link
Author

csdvrx commented Dec 16, 2020

And It's CSI 14t, right? Not OSC.

@skyline75489 my mistake!

BTW I'd love to try your Windows Terminal branch with sixel support, especially if advanced SGR sequences are also supported!

I don't think it's worth considering until we have a genuine use case for it.

@j4james, the use case is being compatible with... about every other terminal emulator.

Right now we don't support Sixel,

Well, eventually you may, and I already do, through tmux-sixel (to be released soon) which passes the sixel sequence "as-is" if the terminal supports them, and if not adapts that into a fallback rendition that works about everywhere.

Here is an example: tmux-sixel-fallback-161-40

You will recognize the current Windows Terminal Preview, straight from the store. It's showing a picture thanks to a conversion of the sixels in colored unicode blocks. Unfortunately, TIOCGWINSZ only works on remote hosts.

I need the size of the terminal in pixels to "maintains compatibility with existing implementations so images do not run off the edge of the screen or only fill half the screen" as mentioned by @OhMeadhbh in #448 (comment)

IMHO, that's at least 3 usecases: compatibility with xterm, proper sixel supoprt, sixel fallback mode support.

and if we did, our implementation would probably have to be independent of font size,

That's very wrong, for reason explained in #448 with several example - images will be stretched or will not fit with the rest of the TUI. Also, it will mess with the display as soon as the font size is altered - something as fast as a ctrl-+ to make the text more legible

so there's no value in reporting a window pixel size for that (other than maybe faking the values if that's necessary to make some apps work).

Well, maybe I'm wrong, but after reading this, it seems to me you want to play the clock on sixel support, waiting out until enough people complain with their "genuine use cases", after which you've already decided you'll do a shoddy job by reporting fake values - basically doing the bare minimum so that apps work poorly -- but hey, at least they may not crash thanks to the fake values!

It doesn't seem very ambitious, and it certainly doesn't inspire me trust in the Terminal future...

On top of that, it's not obvious to me what this sequence is even meant to report

Let's make an educated guess here: don't you think that, maybe, an application drawing pixels on a canvas is interested by the size of the actual canvas it's drawing on, and not by the window decorations?

If in doubt, just fire xterm, and do measurements, you'll see.

some terminals interpret as the actual application window including chrome (i.e. title bar, borders, status bar, etc.), while others report some variation of the text area (although not necessarily the exact writeable area).

Some terminals even report different sizes between TIOCGWINSZ and 14t, until the window is resized and then the values match, like mintty/mintty#1071

There's a name for that: a bug. I documented it in detail as I'm preparing a software demo, and making sure everything will go according to the script.

Another thing to bear in mind is that CSI t is also the DECSLPP sequence, so some terminals will simply interpret CSI 14 t as setting the screen height to 14 lines. That's admittedly rare - I think most that support DECSLPP only accept heights of 24 or more - but given the variability of the responses, even when supported, this doesn't seem like something you'd want to rely on

Terminals are 80x25, as you say yourself DECSLPP only accept heights of 24 or more. But even if it was >25, this is irrelevant: let's not forget that CSI 14t is send not by the terminal, but by the application to ask the terminal size, The only thing Windows Terminal has to do is to answer the query. I fail to see how answering the query may cause issues.

An application that needs to query the terminal may not have been run on a DEC terminal that did interpret 14t as a resize (!!!)

Still, if you believe answering the query from an app making use of xterm control sequences may cause issues, make it a flag: have by default the Terminal refuse do anything.

IMHO that's a bad default, but at least that's something I may be able to work with!

@DHowett
Copy link
Member

DHowett commented Dec 16, 2020

Well hold up.

after which you've already decided you'll do a shoddy job by reporting fake values [...] It doesn't seem very ambitious, and it certainly doesn't inspire me trust in the Terminal future...

You do not need to slander us into doing your preferred thing 😄

If in doubt, just fire xterm, and do measurements, you'll see.

Fortunately, the inimitable egmontkob did exactly this and found existing terminal emulators to be lacking.

"base" means that the reported numbers are the number of cells multiplied by each cell's size,
"extended" means it also includes the standard padding (border), the extra padding in case the
window size is not grid-aligned (e.g. maximized), and the scrollbar.

                \e[14t       ws_[xy]pixel
xterm            base(*)      extended
urxvt            extended     base
pterm (putty)    extended     base
st (suckless)    -            base
VTE              base         -
konsole          -            -
terminology      -            -

(*) Ctrl + right click -> Allow Window Ops

I especially "love" how xterm and urxvt are the exact opposite of each other :-)

(source (2017))

But even if it was >25, this is irrelevant: let's not forget that CSI 14t is send not by the terminal, but by the application to ask the terminal size

Right. I believe that's James' point: the application would also be the source of DECSLPP. The xterm control sequences documentation does call out the alternate treatment of DECSLPP and XTWINOPS.

@csdvrx
Copy link
Author

csdvrx commented Dec 16, 2020

Well hold up.

I don't want to assume wrongly, but I just don't understand at all the logic behind what was proposed in the answer. Seriously.

So I gave the only reasonable explanation that could connect all the dots, since the proposed choices seems contradictory with the stated goals of having a terminal that doesn't break compatibility.

after which you've already decided you'll do a shoddy job by reporting fake values [...] It doesn't seem very ambitious, and it certainly doesn't inspire me trust in the Terminal future...

You do not need to slander us into doing your preferred thing 😄

It's not about doing "my" preferred thing: fake values are in general a bad idea, here especially because it's ignoring the precedent set by what you are trying to replace, thus breaking backwards compatibility.

It's not about preferences or tastes: breaking backwards compatibility without good reasons is very wrong, and I'm sorry but laziness is not a valid reason 😄

If in doubt, just fire xterm, and do measurements, you'll see.

Fortunately, the inimitable egmontkob did exactly this and found existing terminal emulators to be lacking.

Actually, I'd say he found out exactly what I was saying: xterm returns the base through \e[14t.

I especially "love" how xterm and urxvt are the exact opposite of each other :-)

Let's be honest: Windows Terminal aims to replace the currently deployed terminals whenever possible, and besides not breaking compatibility whenever possible, that means putting a focus on the most widely used, not on the obscure ones.

Do you really think there're a lot of corporate deployments of st and urxvt? Especially when compared to xterm?

Personally, I don't think so, but if you REALLY want to cover all bases, add 2 flags:

  • one to plainly ignore 14t queries, which should be answered by default
  • one to return extended instead of base (even if I can't honestly see any reason to use the extended coordinates, and it seems to me to be a historical bug that became a quirk)

If you can "telemetry" that, I think you'll find <0.5% of people using Windows Terminal will use them

Right. I believe that's James' point: the application would also be the source of DECSLPP. The xterm control sequences documentation does call out the alternate treatment of DECSLPP and XTWINOPS.

So what you say is that you want to reserve the opportunity to answer DECSLPP requests in the future? Fair enough! More backwards compatibility is better!

Here's an idea:

  • 14t will mean 99.5% of the time "give me the coordinates", as terminals are 80x25, and 14<<<25 enough to be barely usable, and without a clear goal (setting to 2 lines? I could buy that, to have a command prompt somwhere. 25? I could buy that, to restore to normal. >25? Of course! But nothing makes 14 special)
  • so a safe default would be, resize with any other values besides 14, but with 14 answer the query by providing the size of the base window
  • have a flag to "remove" this exception for 14 if you are really worried about people with terminals having 14 lines
  • eventually have another flag to answer 14 by giving the extended coordinates if you are really worried about keeping compatibility with the anecdotal terminals like st and urxvt

@DHowett DHowett added Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Area-VT Virtual Terminal sequence support Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal. labels Dec 17, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Dec 17, 2020
@DHowett DHowett added this to the Console Backlog milestone Dec 17, 2020
@DHowett
Copy link
Member

DHowett commented Dec 17, 2020

@zadjii-msft If you agree, yank Triage. Conhost backlog, requires server work (we don't even have support for ioctls, and no windows console API allows for pixel sizing) and design. Did some prototyping on a new communication channel in the hax/l9 branch to see how easy it would be for us to extend the Windows API without shipping a new version of Windows. Impacts all three product areas (terminal, conhost, conpty) but I only marked the two.

@skyline75489
Copy link
Collaborator

@csdvrx I appreciate your interest in my work. However, my sixel branch should be considered very obsolete. The main blocker is the performance. It takes a huge amount of refactoring to implement streaming sixel data directly to the terminal and make it possible to fix the performance issue. Until then my branch is just a PoC.

If you’re still interested, @yatli actually got it up and running, I believe. He might had a better idea than I do.

@zadjii-msft
Copy link
Member

Sure yea, we can stick this on the backlog, with the caveat of I'm upgrading this to a scenario, because implementing an entirely new API layer through conpty to the Terminal is definitely not something I'd consider a "task" or even "deliverable" 😄

@zadjii-msft zadjii-msft added Issue-Scenario and removed Issue-Task It's a feature request, but it doesn't really need a major design. labels Dec 17, 2020
@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Dec 17, 2020
@csdvrx
Copy link
Author

csdvrx commented Dec 19, 2020

implementing an entirely new API layer through conpty to the Terminal

@zadjii-msft Maybe I'm not correctly perceiving the magnitude of the problem, but without talking about TIOCGWINSZ, is it that difficult for the terminal to intercept the 14 sequence and reply with its own geometry? Or is it because you want to make a more generic solution?

The way I see it, the terminal must knows about the font it's using, and the geometry of the canvas it's flowing the text to, so it seems to be just a multiplication away.

@DHowett About the difference between xterm and urxvt, I've learned xterm now supports 14;2 which gives the dimension with the decorations included: mintty/mintty#1071 (comment)

@skyline75489 Yes, I'm very interested in sixel support for some very specific reasons, so thanks a lot for the suggestion, I'll follow up with yatli!

@benjajaja
Copy link

This is relevant once again, now that there is sixel support. The use case is that a sixel image can be displayed, but it is unknown what area will be covered by it or if it fits at all in the window. It is desirable to know the window size in pixel, so that together with the already implemented cols*rows it can be determined how many "cells" a sixel image covers. Only then can the image can be placed inside TUIs.

@j4james
Copy link
Collaborator

j4james commented Oct 6, 2024

@benjajaja We added CSI 14 t and CSI 16 t in PR #17504. That was released at the same time as the sixel support.

@benjajaja
Copy link

@j4james I didn't even know these existed! Thank you many times!

@mikoto2000
Copy link

I have tried CSI 14 t and CSI 16 t in Windows Terminal Preview and it seems to work fine.

However, the TIOCGWINSZ pixel in ioctl still returns zero.
Are there any plans to provide support for this?

See: #18192

tmeijn pushed a commit to tmeijn/dotfiles that referenced this issue Dec 9, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [sxyazi/yazi](https://github.com/sxyazi/yazi) | minor | `v0.3.3` -> `v0.4.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>sxyazi/yazi (sxyazi/yazi)</summary>

### [`v0.4.0`](https://github.com/sxyazi/yazi/releases/tag/v0.4.0)

[Compare Source](sxyazi/yazi@v0.3.3...v0.4.0)

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](sxyazi/yazi#1772

#### Spotter

sxyazi/yazi#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 sxyazi/yazi#1556 (Thanks to [@&#8203;diegodorado](https://github.com/diegodorado)), and it works across all 4 image backends Yazi supports (kitty graphics-protocol, Inline images protocol, Sixel graphics format, Überzug++).

![screenshot-002179](https://github.com/user-attachments/assets/1ee9a147-3bc8-4fca-a495-a0ea0bfe84e5)

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

sxyazi/yazi#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:

```toml

### 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 sxyazi/yazi#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](https://yazi-rs.github.io/docs/configuration/keymap#manager) to the current Yazi instance. The format is:

```sh
ya emit <command> <args>
```

For example:

```sh
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`:

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

For example:

```sh
ya emit-to "$YAZI_ID" cd /tmp
```

#### Support Passing Arguments to Previewer/Preloader/Spotter/Fetcher

With sxyazi/yazi#1979, you can now pass arguments to previewers, preloaders, spotters, and fetchers when configuring them:

```toml

### 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 sxyazi/yazi#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 sxyazi/yazi#1882:

```toml
[[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 [@&#8203;DirkFi](https://github.com/DirkFi) for his excellent work on sxyazi/yazi#1583

#### Prioritize Paths That Need to Be Processed First During Bulk Renaming

The bulk renaming feature now has smart conflict resolution, done in sxyazi/yazi#1801 (thanks to [@&#8203;yw1ee](https://github.com/yw1ee)).

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

```sh
1
2
3
```

And renaming them to:

```sh
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:

```sh
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`](microsoft/terminal#8581).

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

sxyazi/yazi#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 sxyazi/yazi#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

-   fix: match icon by extension case-insensitive by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1614
-   refactor: privatize `url` of the `File` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1619
-   perf: introduce URN to speed up large directory file sorting by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1622
-   fix: set `allow-passthrough` always to `all` instead of `on` to prevent overriding a user setting with a higher priority `all` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1626
-   fix: set a dedicated `Mimetype` agency to reconcile regular files and search results by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1627
-   feat: make the builtin `extract` plugin support compressed tarballs (`*.tar.gz`, `*.tar.bz2`, etc.) by [@&#8203;DirkFi](https://github.com/DirkFi) in sxyazi/yazi#1583
-   feat: support transparent image preview by [@&#8203;diegodorado](https://github.com/diegodorado) in sxyazi/yazi#1556
-   perf: avoid unnecessary allocations in base64 encoding of IIP by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1639
-   perf: introduce URN to speed up large directory locating by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1648
-   feat: support setting different input titles for `create --dir`  by [@&#8203;Tyarel8](https://github.com/Tyarel8) in sxyazi/yazi#1650
-   perf: introduce URN to speed up large directory file updates by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1652
-   refactor: ensure that each `Url` contains the full location information by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1659
-   feat: support calling methods in builtin plugins with arbitrary types of arguments (`self` can now be omitted) by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1666
-   feat: add the `area()` API for renderable elements by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1667
-   fix: one file's mime-type changed multiple times without triggering a preview again by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1682
-   fix: `enter` and `leave` commands should treat the search results as regular entities by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1687
-   fix: `magick` previewer for multi-layered image files with `-flatten` argument by [@&#8203;v3natio](https://github.com/v3natio) in sxyazi/yazi#1684
-   feat: improve jemalloc memory efficiency by [@&#8203;dm9pZCAq](https://github.com/dm9pZCAq) in sxyazi/yazi#1689
-   feat: adapt for image preview in the Rio terminal by [@&#8203;raphamorim](https://github.com/raphamorim) in sxyazi/yazi#1690
-   fix: increase the revision when there is a change in `Urn` on updating by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1691
-   feat: allow overriding and rewriting the sync methods of builtin plugins by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1695
-   feat: add more context to error messages by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1701
-   fix: replace control characters to printable characters in plain text preview by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1704
-   feat: async micro task initialization error handling by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1710
-   feat!: make `backspace` command not close the input even when value is empty by [@&#8203;XYenon](https://github.com/XYenon) in sxyazi/yazi#1680
-   feat: reuse the `code` previewer seeking behavior for `json`, `archive`, and `empty` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1721
-   fix: temporarily disable TIFF decoding by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1723
-   refactor: turn `RectRef`, `PaddingRef`, `PositionRef` into `Rect`, `Padding`, `Position` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1730
-   refactor: use `Kgp` instead of `Kitty` since "Kitty" is a terminal emulator not a protocol name by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1732
-   fix: compositors not supported by Überzug Wayland layer, or WSL not with WezTerm should fallback to Chafa by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1735
-   fix: clamp when seeking a non-zero unit between `-1` and `1` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1736
-   fix: upserting operation should handle deleting in edge cases where the source and target URNs are different by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1737
-   refactor: derive the `Into<Opt>` trait with procedural macros to avoid bloat by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1742
-   perf: merge multiple file operations into one to greatly speed up updates in large directories by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1745
-   fix!: introduce a new `btime` term to align `ctime` with Unix by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1761
-   feat: `yazi --debug` supports detecting whether `tmux` is built with `--enable-sixel` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1762
-   refactor: simplify module exports by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1770
-   refactor!: rename the term `select` to `toggle` to reserve `select` for future use by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1773
-   feat!: add `ui.Text`, `ui.Table`, remove `ui.Paragraph` and `ui.ListItem` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1776
-   feat!: decouple `ui.List`, `ui.Bar`, `ui.Border`, and `ui.Gauge` from coordinates by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1782
-   feat: prevent paths from being treated as options in `file` command by [@&#8203;gaesa](https://github.com/gaesa) in sxyazi/yazi#1783
-   refactor: replace `Metadata` with `Cha` in the file scheduler to improve interoperability with `yazi-fs` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1785
-   feat: append the suffix to the end when generating unique filenames for directories, i.e., after not before the extension by [@&#8203;Saru2003](https://github.com/Saru2003) in sxyazi/yazi#1784
-   fix: images were not cleared when closing a tab in front of the current tab by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1792
-   feat: add a compatibility layer for `ui.Paragraph` to help users transition more smoothly to the new `ui.Text` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1794
-   refactor: remove migration code as it's no longer needed and causes errors by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1795
-   feat: custom styles for the `confirm` component by [@&#8203;GrzegorzKozub](https://github.com/GrzegorzKozub) in sxyazi/yazi#1789
-   perf: apply rotate in place to images with orientation by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1807
-   feat: add ICC profile to images for better color accuracy by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1808
-   fix: use std copy function in a blocking thread by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1817
-   feat: allow customizing Zoxide's FZF options with `YAZI_ZOXIDE_OPTS` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1822
-   fix: use a unique `Id` for each tab by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1826
-   feat: launch from preset settings if the user's config cannot be parsed by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1832
-   fix: reset image rendering and skip peeking if the TUI in the background by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1833
-   refactor: add tests for `Pattern::match_path` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1837
-   perf: eliminate all memory reallocations during sorting by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1846
-   feat: suggest keywords in the header if a finder is active by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1847
-   fix: copy the CWD path regardless even if the directory is empty by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1849
-   perf: introduce reflow for the rendering engine by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1863
-   fix: wrong file list offset squeeze when `scrolloff = 0` by [@&#8203;aidancz](https://github.com/aidancz) in sxyazi/yazi#1866
-   refactor: use for loop to generate completions file by [@&#8203;Integral-Tech](https://github.com/Integral-Tech) in sxyazi/yazi#1869
-   fix: use complete rendering instead of partial rendering for no task progress report by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1876
-   refactor: destructure tuples to enhance readability by [@&#8203;Integral-Tech](https://github.com/Integral-Tech) in sxyazi/yazi#1874
-   feat: new `copy --separator` option to allow specifying the path separator by [@&#8203;alan910127](https://github.com/alan910127) in sxyazi/yazi#1877
-   feat: allow disabling certain preset keybinds with the new `noop` virtual command by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1882
-   feat: include package revision hash in `ya pack --list` by [@&#8203;yudai0804](https://github.com/yudai0804) in sxyazi/yazi#1884
-   feat: add a new `tab` parameter for all tab-specific commands to specify which one by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1885
-   feat: support searching with the alias `fdfind` if `fd` cannot be found by [@&#8203;Integral-Tech](https://github.com/Integral-Tech) in sxyazi/yazi#1889
-   feat!: deprecate `--sync` option for the `plugin` command by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1891
-   perf: lazy load `ui`, `ya`, `fs`, and `ps` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1903
-   chore: add `CODE_OF_CONDUCT.md` by [@&#8203;Perfectio07](https://github.com/Perfectio07) in sxyazi/yazi#1911
-   feat: spotter by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1802
-   feat: `noop` for spotters by [@&#8203;boydaihungst](https://github.com/boydaihungst) in sxyazi/yazi#1924
-   fix: show "0/0" instead of "1/0" in empty directories by [@&#8203;Integral-Tech](https://github.com/Integral-Tech) in sxyazi/yazi#1925
-   fix!: eliminate the `x-` prefix in mime-types by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1927
-   refactor: make error messages more user-friendly by [@&#8203;Integral-Tech](https://github.com/Integral-Tech) in sxyazi/yazi#1935
-   refactor: remove unnecessary UI element construction by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1938
-   feat!: use an `Error` userdata instead of a plain error code for I/O errors by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1939
-   feat: new log system by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1945
-   perf: introduce copy-on-write for event system to eliminate all memory reallocations by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1962
-   feat: true custom `mime` fetcher support - using user rules even during open or in watcher by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1976
-   feat: support `assets` installation for the `ya pack` subcommand by [@&#8203;zooeywm](https://github.com/zooeywm) in sxyazi/yazi#1973
-   feat: new `ya emit` and `ya emit-to` subcommands to emit commands to a specified instance for execution by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1979
-   feat: new `load` DDS event by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1980
-   feat!: remove the meaningless `--confirm` option to simplify the `shell` command by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1982
-   feat: move notification from top-right to bottom-right corner to avoid covering content as much as possible by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1984
-   fix: propagate and update the directory node till its first parent when the files of a directory change by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1987
-   fix: missing a repeek on unyanking files in the hovered folder by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#1988
-   fix: revise `revision` if the new file list is empty but the previous one was not by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#2003
-   feat: fallback to `CSI 16 t` for certain terminals that do not support `TIOCGWINSZ` by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#2004
-   docs: add README for default configuration files by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#2005
-   fix: respect `PREVIEW.image_quality` for the default PDF previewer by [@&#8203;gaesa](https://github.com/gaesa) in sxyazi/yazi#2006
-   fix: introduce own `CWD` instead of `chdir` to avoid potential race conditions by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#2008
-   fix: `backspace --under` didn't map UTF-8 character code points to byte indices by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#2010
-   chore: bump version to 0.4.0 by [@&#8203;sxyazi](https://github.com/sxyazi) in sxyazi/yazi#2011

#### New Contributors

-   [@&#8203;DirkFi](https://github.com/DirkFi) made their first contribution in sxyazi/yazi#1583
-   [@&#8203;diegodorado](https://github.com/diegodorado) made their first contribution in sxyazi/yazi#1556
-   [@&#8203;Tyarel8](https://github.com/Tyarel8) made their first contribution in sxyazi/yazi#1650
-   [@&#8203;v3natio](https://github.com/v3natio) made their first contribution in sxyazi/yazi#1684
-   [@&#8203;dm9pZCAq](https://github.com/dm9pZCAq) made their first contribution in sxyazi/yazi#1689
-   [@&#8203;raphamorim](https://github.com/raphamorim) made their first contribution in sxyazi/yazi#1690
-   [@&#8203;Saru2003](https://github.com/Saru2003) made their first contribution in sxyazi/yazi#1784
-   [@&#8203;GrzegorzKozub](https://github.com/GrzegorzKozub) made their first contribution in sxyazi/yazi#1789
-   [@&#8203;aidancz](https://github.com/aidancz) made their first contribution in sxyazi/yazi#1866
-   [@&#8203;alan910127](https://github.com/alan910127) made their first contribution in sxyazi/yazi#1877
-   [@&#8203;yudai0804](https://github.com/yudai0804) made their first contribution in sxyazi/yazi#1884
-   [@&#8203;Perfectio07](https://github.com/Perfectio07) made their first contribution in sxyazi/yazi#1911
-   [@&#8203;boydaihungst](https://github.com/boydaihungst) made their first contribution in sxyazi/yazi#1924

**Full Changelog**: sxyazi/yazi@v0.3.3...v0.4.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Area-VT Virtual Terminal sequence support Issue-Scenario Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

7 participants