fastfetch-cli / fastfetch

A maintained, feature-rich and performance oriented, neofetch like system information tool.
MIT License
10.97k stars 425 forks source link

[win] flashfetch.exe v2.9.1.0 say about wrong font terminal? #784

Closed Zeroes1 closed 7 months ago

Zeroes1 commented 7 months ago

it's bug or not? :)

Far Manger 3 x64/CMD ran in Windows Terminal (portative mode) i run under FAR/cmd flashfetch.exe after fastfetch.exe

flashfetch.exe say:

Terminal: Windows Terminal 1.21.2404.5001 Terminal Font: Cascadia Mono (12pt) it's like default font for WT. wrong info it's data from"%LOCALAPPDATA%\Microsoft\Windows Terminal\settings.json" it's right path if WT runned not portative mode

in portative mode setting here: <folder where WindowsTerminal.exe>\settings\settings.json

fastfetch.exe say: Terminal Font: Fira Code (16pt) right info

Zeroes1 commented 7 months ago

image image

Zeroes1 commented 7 months ago

portative mode of WT:

download ZIP version of WT, and put to folder file: .portable [sic! with dot]

or download canary build ( portable as default)

CarterLi commented 7 months ago

What if you run fastfetch / flashfetch directly in CMD?

CarterLi commented 7 months ago

Terminal: Windows Terminal 1.21.2404.5001 Terminal Font: Cascadia Mono (12pt) it's like default font for WT. wrong info it's data from"%LOCALAPPDATA%\Microsoft\Windows Terminal\settings.json"

Fastfetch / Flashfetch assumes Cascadia Mono if it fails to find settings.json. Can you change the font configuration in settings.json to something else and see if flashfetch can detect the change?

Zeroes1 commented 7 months ago

1) cmd under conhost;

fastfech/flashfetch: Terminal: Windows Terminal Preview Terminal Font: Cascadia Mono (12pt)

it's WT from "%LOCALAPPDATA%\Microsoft\WindowsApps\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe" i dont use this.

2) cmd under WT same resut as FAR manager topic#1

3) if i rename "%LOCALAPPDATA%\Microsoft\Windows Terminal\settings.json" to _settings.json flashfetch.exe dont show info about font (skip the line :) if i copy my portable C:\UTILITY\Terminal\settings\settings.json to "%LOCALAPPDATA%\Microsoft\Windows Terminal\settings.json" flashfetch.exe show my font: Terminal Font: Fira Code (16pt)

CarterLi commented 7 months ago

Do you use WT preview version or standard version?

What does fastfetch -s terminal:terminalfont --format json print?

CarterLi commented 7 months ago

Okey. The offical doc requires .portable to be a file. However WT does support .portable being a folder.

Will fix it. For now, you may change .portable to an empty file. Then fastfetch should work.

Zeroes1 commented 7 months ago

1) I use portable version WT run from here: C:\UTILITY\Terminal\

fastfetch -s terminal:terminalfont --format json [ { "type": "Terminal", "result": { "processName": "WindowsTerminal.exe", "exe": "C:\\UTILITY\\Terminal\\WindowsTerminal.exe", "exeName": "WindowsTerminal.exe", "exePath": "C:\\UTILITY\\Terminal\\WindowsTerminal.exe", "pid": 9524, "ppid": 7772, "prettyName": "Windows Terminal", "version": "1.21.2404.5001", "tty": "" } }, { "type": "TerminalFont", "result": { "font": { "name": "Fira Code", "size": "16", "styles": [], "pretty": "Fira Code (16pt)" }, "fallback": { "name": "", "size": "", "styles": [], "pretty": "" } } } ] it same result if make (under cmd over WT) fastfetch -s terminal:terminalfont --format json > config.txt

but if make (under Far Manager over WT) fastfetch -s terminal:terminalfont --format json > config.txt i got wrong info:

[ { "type": "Terminal", "result": { "processName": "Far.exe", "exe": "C:\\Far4\\Far.exe", "exeName": "Far.exe", "exePath": "C:\\Far4\\Far.exe", "pid": 11200, "ppid": 9524, "prettyName": "Far", "version": "3.0.6302.0", "tty": "" } }, { "type": "TerminalFont", "error": "Unknown terminal: Far.exe" } ] Another BUG?

if run under ( Far Manager over WT) fastfetch -s terminal:terminalfont --format json on screen out right information (like cmd)

Zeroes1 commented 7 months ago

trouble only if i redirecting output to file (under FAR under WT) if i out to screen to all OK open to new bug :/ ?

CarterLi commented 7 months ago

Seems that far spawns CMD to execute complex commands. In this case, fastfetch will be spawned by CMD. So that CMD will be detected as shell and far will be detected as terminal because far is the parent process of the shell.

There's no way to know if CMD is the real shell or not. I think I will just leave this case unsupported.

CarterLi commented 7 months ago

far.exe will be ignored when detecting terminal. Please try the latest dev build.

Zeroes1 commented 7 months ago

lol at home i no have trouble №2 with 2.9.1.0 relis

about №1 i download latest dev https://github.com/fastfetch-cli/fastfetch/actions/runs/8602897045/artifacts/1394775325

but flashfetch.exe skip line with font, fastfetch.exe show rght info

image

WT at home and at work same config.

Zeroes1 commented 7 months ago

image

CarterLi commented 7 months ago

I can't reproduce it. fastfetch and flashfetch share the same code for terminal font detection. It should work.

Zeroes1 commented 7 months ago

i check situation atwork (first found problem area) №2 trouble is gone

but №1 anyway LATEST DEV build flashfetch.exe try get info about terminal font wrong path "%LOCALAPPDATA%\Microsoft\Windows Terminal\settings.json" - it's not current setting fastfetch.exe get from right path - C:\UTILITY\Terminal\settings\settings.json

may be later i check code himself...

Zeroes1 commented 7 months ago

may be help info for found trouble:

latest DEV fastfetch.exe -c ci.jsonc say: Terminal Font: Cascadia Mono (12pt)

fastfetch.exe -c software.jsonc say Terminal Font: Fira Code (16pt)

=)

CarterLi commented 7 months ago

Still make no difference for me.

Please make sure that fastfetch succeeded in finding the correct, full path of terminal process.

That is to say, fastfetch -c ci.jsonc --format json should print something like

  {
    "type": "Terminal",
    "result": {
      "processName": "WindowsTerminal.exe",
      "exe": "C:\\Users\\zhang\\Desktop\\terminal-1.19.10821.0\\WindowsTerminal.exe", // currect, absolute path; not relative path or file name only.
      "exeName": "WindowsTerminal.exe",
      "exePath": "C:\\Users\\zhang\\Desktop\\terminal-1.19.10821.0\\WindowsTerminal.exe",
      "pid": 10768,
      "ppid": 5608,
      "prettyName": "Windows Terminal",
      "version": "1.19.2403.22001",
      "tty": ""
    }
  }