hykilpikonna / hyfetch

🏳️‍🌈 🏳️‍⚧️ Neofetch with LGBTQ+ pride flags!
MIT License
1.15k stars 90 forks source link

Fastfetch backend always reports shell as Python #260

Closed edbefee3-3888-462a-9411-741b7e9eb54e closed 2 months ago

edbefee3-3888-462a-9411-741b7e9eb54e commented 2 months ago

Describe the bug

When using the Fastfetch backend (fastfetch or fastfetch-old) , the shell is reported as "python" or "python3" regardless of the user's shell.

Expected behavior

The Shell to show the user shell (eg. bash 5.2.26) as it does with the Neofetch backend, or when running it directly from the shell

Screenshots

Screenshot_20240501_070631

Config file

{
    "preset": "transgender",
    "mode": "rgb",
    "light_dark": "dark",
    "lightness": 0.5,
    "color_align": {
        "mode": "horizontal",
        "custom_colors": [],
        "fore_back": null
    },
    "backend": "fastfetch",
    "args": null,
    "distro": null,
    "pride_month_shown": [],
    "pride_month_disable": false
}
hykilpikonna commented 2 months ago

I think this is something that I cannot solve, because python will be the parent process of fastfetch if hyfetch launches fastfetch. So, unless fastfetch excludes python from being identified as a shell, there's no easy solution to this problem.

A possible solution I can implement is to capture the output of fastfetch and replace the text like fastfetch | sed ..., but that would be very hacky.

@CarterLi I'm curious about your opinion on this.

CarterLi commented 2 months ago

There are shells written in python so I cant do that.

https://xon.sh/

CarterLi commented 2 months ago

Ignored & tested in Linux (https://github.com/fastfetch-cli/fastfetch/commit/688d9b00ab46f9233276fd9f7b91080fdb9c0696)

@hykilpikonna Just found that you can't select the default backend in first-run wizard. I suggest adding it and preferably make fastfetch default backend on Windows.

CarterLi commented 2 months ago

Ignored & tested in Windows (https://github.com/fastfetch-cli/fastfetch/commit/023e767237294aec9f82515822c257939457511b)

image

  1. Hyfetch stuck at Is your terminal in light mode or dark mode? on first run. Solved by manually creating ~/.config/hyfetch.json
  2. Hyfetch forces it being run in Git bash, despite I am using fastfetch as backend and both hyfetch (the python part) and fastfetch don't use bash at all...
CarterLi commented 2 months ago

Also, it would be appreciated if you can metion backend selection feature in the README

hykilpikonna commented 2 months ago

Ignored & tested in Linux (https://github.com/fastfetch-cli/fastfetch/commit/688d9b00ab46f9233276fd9f7b91080fdb9c0696)

Thanks for adding the support!

@hykilpikonna Just found that you can't select the default backend in first-run wizard. I suggest adding it and preferably make fastfetch default backend on Windows.

Also, it would be appreciated if you can metion backend selection feature in the README

Right, I'll implement these before the 1.5.0 release.

Hyfetch forces it being run in Git bash, despite I am using fastfetch as backend and both hyfetch (the python part) and fastfetch don't use bash at all...

Currently it uses bash neofetch to initially detect the distro (because of a lazy decision when I wrote it). Maybe it would be better to offload that part to a python implementation so that running fastfetch do not require bash. But also, I haven't tested fastfetch to the full extent (e.g. on older Windows releases that don't use powershell or windows terminal as the default termemu, but use the cmd.exe that doesn't support ANSI TrueColor RGB colors in which case Git Bash will do the translation from ANSI to windows API). I'll do more testing on this.

hykilpikonna commented 2 months ago

@edbefee3-3888-462a-9411-741b7e9eb54e This is fixed on the fastfetch end so it will be fixed when the next fastfetch release is available.

CarterLi commented 2 months ago

I haven't tested fastfetch to the full extent (e.g. on older Windows releases that don't use powershell or windows terminal as the default termemu, but use the cmd.exe that doesn't support ANSI TrueColor RGB colors in which case Git Bash will do the translation from ANSI to windows API). I'll do more testing on this.

ConEmu + CMD are a much more native and light-weight option than installing Git Bash

image