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

[BUG] Custom object inherits key from previous custom object if key is blank #1477

Open
nickgerace opened this issue Jan 2, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@nickgerace
Copy link

General description of bug:

  • What happened: if you create a second "custom" object and leave the key blank, it will inherit the last "custom" key
  • What should happen: the second "custom" object's key should be blank
  • Fastfetch version used: 2.33.0
  • Did it work in an older version: unknown
  • Where did you get the binary: nixpkgs
  • Does this issue still occur in the latest dev build?: unknown

Often helpful information:

Configuration file:

{
  "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
  "display": {
    "size": {
      "ndigits": 0
    }
  },
  "modules": [
    {
      "type": "custom",
      "key": "My Key Here",
      "format": "Some text",
    },
    {
      "type": "custom",
      "format": "―――――――――――――――――――――――"
    },
  ]
}

Bad output:

My Key Here: Some text
My Key Here: ―――――――――――――――――――――――

Expected output:

My Key Here: Some text
―――――――――――――――――――――――

If fastfatch crashed or froze

n/a

If fastfetch is slow

n/a

If an image or logo didn't show

n/a

If fastfetch behaves incorrectly on shell startup

n/a

@nickgerace nickgerace added the bug Something isn't working label Jan 2, 2025
@nickgerace nickgerace changed the title [BUG] [BUG] Custom object inherits key from previous custom object if key is blank Jan 2, 2025
@CarterLi
Copy link
Member

CarterLi commented Jan 3, 2025

You can set the key to a white space, which is used as a special value for removing keys.

    {
      "key": " ",
      "type": "custom",
      "format": "―――――――――――――――――――――――"
    },

@nickgerace
Copy link
Author

nickgerace commented Jan 3, 2025

Thank you! That worked as a workaround.

I still believe this is a bug, but I appreciate the workaround.

nickgerace added a commit to nickgerace/dotfiles that referenced this issue Jan 3, 2025
@CarterLi
Copy link
Member

CarterLi commented Jan 6, 2025

FYI this issue affects not only key of custom, but also all other modules and properties, as it was designed like that (counter-intuitive though). However, we won't change current behavior before removing support of module specific command flags, probably.

@nickgerace
Copy link
Author

Ah that makes sense. Okay that sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants