hyfetch icon indicating copy to clipboard operation
hyfetch copied to clipboard

[compatibility] Windows Terminal: UI broken on first run with older versions of Git

Open slackingfred opened this issue 1 year ago • 3 comments

Describe the bug

Display of configuration options on first run (i.e. when %USERPROFILE%.config\hyfetch.json is not present) is totally corrupt.

Related: #41. That issue was fixed at the time, but I'm sure the display has became corrupt again by as early as Sep 2023.

  • [x] Does this issue still occur in the master branch? (Required)

Expected behavior

Usable configuration screens like that in Linux (the following screenshots are taken from a SSH session to a Ubuntu 22.04 machine):

屏幕截图 2024-01-06 095805

屏幕截图 2024-01-06 095836

Screenshots

System information:

  • Windows 11 Build 22631.2861
  • Windows Terminal 1.18.3181.0
  • PowerShell 5.1.22621.2506 (probably irrelevent because the problem is also present in Command Prompt)

What I am seeing when running HyFetch 1.4.11 or master:

屏幕截图 2024-01-06 094243

屏幕截图 2024-01-06 100910

Config file

None (first run)

Additional context

HyFetch runs okay after creating a default config file by pressing Enter for each question.

slackingfred avatar Jan 06 '24 15:01 slackingfred

Do you have git bash installed? Can you show me the output of the following command?

python -c "from hyfetch import neofetch_util; print(neofetch_util.ensure_git_bash())"

This should return the bash backend that's used to call neofetch. (which returns git bash C:\Program Files\Git\bin\bash.exe for me)

Without further details, I can't seem to replicate this issue on my installation of Windows 11.

image

hykilpikonna avatar Jan 12 '24 19:01 hykilpikonna

Yes, I have Git Bash (included in Git for Windows) installed -- but it is a pretty old version (installed in 2020 and never updated). Would that be the crux?

PS C:\Users\bspub> python3.8 -c "from hyfetch import neofetch_util; print(neofetch_util.ensure_git_bash())"
C:\Program Files\Git\bin\bash.exe
PS C:\Users\bspub> git --version
git version 2.28.0.windows.1

slackingfred avatar Jan 12 '24 20:01 slackingfred

I just tried downgrading to Git 2.28, and yes the problem exists. I'll bisect to the exact version if I have time but yes the solution seems to be just install the latest Git.

image

hykilpikonna avatar Jan 12 '24 23:01 hykilpikonna