fastfetch-cli / fastfetch

An actively maintained, feature-rich and performance oriented, neofetch like system information tool.
MIT License
9.21k stars 375 forks source link

presets not detected by file name in v2.0.1 #529

Closed jessebot closed 1 year ago

jessebot commented 1 year ago

General description of bug

What happened

preset not detected, specifically ~/.local/share/fastfetch/presets/docker_space_chalk.jsonc

$ fastfetch --load-config docker_space_chalk.jsonc
Error: couldn't find config: docker_space_chalk.jsonc
$ fastfetch --load-config docker_space_chalk
Error: couldn't find config: docker_space_chalk

Screenshot

fastfetch also seems to write over the last command buffer when it does print:

Screenshot 2023-08-21 at 14 24 18

What should happen

presets should be detected and queryable by their name such as docker_space_chalk

Did it work in an older version

yes, but I can't remember which version I was on before v2.0.1 went through in an auto-update

Where did you get the binary

homebrew

$ brew info fastfetch
==> fastfetch: stable 2.0.1 (bottled), HEAD
Like neofetch, but much faster because written mostly in C
https://github.com/fastfetch-cli/fastfetch
/opt/homebrew/Cellar/fastfetch/2.0.1 (38 files, 1.4MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-08-21 at 12:33:49
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/f/fastfetch.rb
License: MIT
==> Dependencies
Build: chafa ✘, cmake ✘, glib ✔, imagemagick ✔, pkg-config ✔, vulkan-loader ✘
==> Options
--HEAD
        Install HEAD version
==> Caveats
Bash completion has been installed to:
  /opt/homebrew/etc/bash_completion.d
==> Analytics
install: 352 (30 days), 1,144 (90 days), 1,466 (365 days)
install-on-request: 352 (30 days), 1,144 (90 days), 1,466 (365 days)
build-error: 0 (30 days)

Does this issue still occurs in the latest dev build?

I believe I am on HEAD right now.

Often helpful information:

The content of the configuration file you use (if any)

{
    "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
    "logo": {
        "width": 29,
        "height": 13,
        "type": "sixel",
        "source": "spacechalkwhale.jpg"
    },
    "display": {
        "percentType": 9, // colored percent number
        "color": {
            "keys": "magenta",
            "title": "bright_blue"
        }
    },
    "modules": [
        "title",
        "separator",
        "os",
        "host",
        "uptime",
        "packages",
        "theme",
        "cpu",
        "gpu",
        "memory",
        "disk",
        "battery",
        "break",
        "colors"
    ]
}

Output of env NO_CONFIG=1 fastfetch --load-config all --show-errors --stat --multithreading false --disable-linewrap false --hide-cursor false:

 env NO_CONFIG=1 fastfetch --show-errors --stat --multithreading false --disable-linewrap false --hide-cursor false && fastfetch --version
                     ..'          jesse@Jesses-MBP.lan                                                                                       0ms
                 ,xNMM.           --------------------                                                                                       0ms
               .OMMMMo            OS: macOS Ventura 13.5 22G74 arm64                                                                         0ms
               lMM"               Host: MacBook Pro (14-inch, 2021)                                                                          0ms
     .;loddo:.  .olloddol;.       Kernel: 22.6.0                                                                                             0ms
   cKMMMMMMMMMMNWMMMMMMMMMM0:     Uptime: 26 days, 23 hours, 56 mins                                                                         0ms
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.     Packages: 184 (brew), 20 (brew-cask)                                                                       0ms
 XMMMMMMMMMMMMMMMMMMMMMMMX.       Shell: bash 5.2.15                                                                                         6ms
;MMMMMMMMMMMMMMMMMMMMMMMM:        Display (Color LCD): 3024x1964 @ 120Hz (as 1512x982)                                                      21ms
:MMMMMMMMMMMMMMMMMMMMMMMM:        DE: Aqua                                                                                                   0ms
.MMMMMMMMMMMMMMMMMMMMMMMMX.       WM: Quartz Compositor                                                                                      0ms
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.     WM Theme: Blue (Dark)                                                                                      0ms
 'XMMMMMMMMMMMMMMMMMMMMMMMMMMk    Theme: Not supported on this platform                                                                      0ms
  'XMMMMMMMMMMMMMMMMMMMMMMMMK.    Icons: Not supported on this platform                                                                      0ms
    kMMMMMMMMMMMMMMMMMMMMMMd      Font: .AppleSystemUIFont [System], Helvetica [User]                                                        4ms
     ;KMMMMMMMWXXWMMMMMMMk.       Cursor: Fill - Black, Outline - White (32px)                                                               0ms
       "cooc*"    "*coo'"         Terminal: WezTerm 20230712-072601-f4abf8fd                                                                 0ms
                                  Terminal Font: mononoki                                                                                   38ms
                                  CPU: Apple M1 Pro (10)                                                                                     0ms
                                  GPU: Apple M1 Pro (16) [Integrated]                                                                        1ms
                                  Memory: 10.60 GiB / 32.00 GiB (33%)                                                                        0ms
                                  Disk (/): 68.89 GiB / 1.81 TiB (4%) - apfs                                                                 2ms
                                  Battery: 100% [Charging]                                                                                   0ms
                                  Power Adapter: 140W USB-C Power Adapter                                                                    0ms
                                  Locale: en_US.UTF-8                                                                                        0ms
                                                                                                                                             0ms
                                  ████████████████████████
                                  ████████████████████████                                                                                   0ms
fastfetch 2.0.1 (aarch64)

Output of fastfetch --list-features:

threads
vulkan
imagemagick7
chafa
zlib
sqlite3

If my image logo didn't show / work

Thanks as always for maintaining fastfetch :) I still use it daily and I think the new config and accompanying json schema are very useful :)

CarterLi commented 1 year ago

Thanks for reporting. I will check it tomorrow

CarterLi commented 1 year ago

I got different behaviors for different terminals with sixel image protocol

image

fastfetch also seems to write over the last command buffer when it does print

That's because fastfetch calucated image height is different from the actual height printed in terminal. After a image is printed, the cursor moves after the image. To print other text at the right of the image, fastfetch must move the cursor back, so the actual height of the image used in terminal ( the number of lines to move the cursor up ) must be known. However, terminals won't tell you the actuall image height, fastfetch must guess ( by original image height, terminal charactor height, etc )

Neofetch solve this issue by clearing the entire screen, so that an image is always printed at the top of the terminal. Fastfetch may implement the same behavior in the future.

However as for now, I HIGHLY recommand that everyone should use kitty-direct or iterm image protocol if your terminal supports them. It's faster and much more reliable. And if your terminal doesn't support kitty-direct or iterm so you have to use sixel, you should always specify --logo-width and --logo-height

CarterLi commented 1 year ago

Wezterm supports kitty-direct in a lot of image formats, Use it and problem resolved.

image

See wiki for more information

CarterLi commented 1 year ago

Presets detection issue should have been fixed in 2.0.2