Replies: 10 comments 15 replies
-
Yes. You may bench them with We have a work around by searching for version string in kitty python files directly, but it doesn't work on NixOS because of the non-standard fs structure. |
Beta Was this translation helpful? Give feedback.
-
I think should be fairly easy to do, I know in Nix I can just do |
Beta Was this translation helpful? Give feedback.
-
Run kitten --version if you want the version fast, not kitty --version. And if you want it really fast use XTGETTCAP which doesn't require calling an external binary at all. Although only some terminals like foot and kitty and xterm implement XTGETTCAP and probably only kitty implements getting version via it. https://sw.kovidgoyal.net/kitty/kittens/query_terminal/ |
Beta Was this translation helpful? Give feedback.
-
On Fri, Jun 21, 2024 at 10:01:55PM -0700, Carter Li wrote:
Really cool! The `XTGETTCAP `supports not only terminal version, but also terminal font.
Note that, version, font etc. are kitty extensions, basic XTGETTCAP supports
only terminfo properties + terminal name.
If you want some more fields added apart from version and font, just
ask. For example, it should be possible to expose the display system
type X11/Wayland+compositor/Cocoa as a field, so you can rely on kitty to
tell you about that, without using env var or other heuristics to guess
it.
|
Beta Was this translation helpful? Give feedback.
-
On Fri, Jun 21, 2024 at 10:32:11PM -0700, Carter Li wrote:
> If you want some more fields added apart from version and font, just ask
I need to support other terminals so thanks
I do want to ask for more image file types support for image protocols besides png :) Wezterm supports a lot of them https://github.com/fastfetch-cli/fastfetch/wiki/Logo-options#kitty-direct
The graphics protocol is not going to support random image formats, if
you need to display non-PNG images using it, convert them using any
number of available tools to either RGBA (for best performance) or PNG.
Doing so is no slower than having the terminal read the original image
file since the terminal must convert the image format to RGBA data
internally anyway. In fact, you can make it faster by caching the RGBA
data and comparing file timestamps to validate the cache. A kitty
graphics protocol supporting terminal then just has to read the RGBA
data from the cached rgba file with no conversion needed.
|
Beta Was this translation helpful? Give feedback.
-
On Fri, Jun 21, 2024 at 10:28:36PM -0700, Carter Li wrote:
I run `echo -e '\eP+q76657273696f6e\e\\'` (`q76657273696f6e` is the hex code of `version`) but kitty reports `P0+r76657273696f6e\`. What's wrong with that?
Remember, these are kitty specific, so the names need to be prefixed by
kitty-query-whatever so for version it would be kitty-query-version.
See query_terminal/main.py in kitty source for details.
|
Beta Was this translation helpful? Give feedback.
-
On Fri, Jun 21, 2024 at 10:53:05PM -0700, Carter Li wrote:
> Why are you passing it via tty? Pass it as a file.
Does it really matter? By passing it via tty you do `write(STDOUT_FILENO, whatever)`. By passing it via file, you create a temp file first; write image content into the file; passing the file name to kitty; remove the temp file. I don't see any benefit of passing it via a temp file.
Dont use a temp file. Use a cached file containing RGBA data. That
way the conversion to RGBA happens only once. The first time fastfetch is
run. On all subsequent runs the conversion of image data to RGBA is
avoided, yielding much better performance than passing the image data
unconverted to the terminal, forcing the terminal to read and convert
that image data instead of just reading the RGBA data directly.
|
Beta Was this translation helpful? Give feedback.
-
On Fri, Jun 21, 2024 at 10:54:50PM -0700, Carter Li wrote:
Image file can be large. Raw RGBA image file can be much larger. Base64 encoded RGBA image file can be even larger. I do want terminals to handle it.
There is no base64 involved. You save the RGBA data as a *binary file*. Pass
only the path to that file encoded as base64 to the terminal.
As for RGBA data being large, when you pass a jpeg image to the
terminal, the terminal has to read that jpeg data, then convert it to
rgba internally anyway to display it. By pre-converting, you avoid
forcing the terminal to do all that work, thereby making the overall
performance better.
|
Beta Was this translation helpful? Give feedback.
-
And just for giggles kitty --version is now faster than alacritty --version |
Beta Was this translation helpful? Give feedback.
-
Kitty
Alacritty
I assume this is because it is calling a external program, which is written in Python (which despite popular belief if done well can be fastish enough*). This might end up being a kitty issue ultimately, but thought it best to report here. The issues page doesn't seem to have template for performance, rather bugs which this isn't really a bug I guess. So either Kitty needs to fix it on their end I guess, or it could be implemented in something faster perhaps?
Beta Was this translation helpful? Give feedback.
All reactions