Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix windows detection to match version #2309

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MrStanDu33
Copy link

@MrStanDu33 MrStanDu33 commented Apr 2, 2023

Description

This PR fixes the wrong windows version displayed when host uses Windows 11.

⚠️ Only tested in WSL2 using Debian, not in Windows itself ⚠️

Thanks to @KWAAY for issuing this bug to me and helping me fixing it.

Reason

This bug was caused by neofetch using the command

wmic.exe os get Version

to get the OS version. But this prompt returns

Version
10.0.25330

even if I am using Windows 11. (my build version is 25330, so it is fine).

You can see a comparison here :
image

But if we use the command

wmic.exe os get Caption

to get the OS version, we get

Caption
Microsoft Windows 11 Pro Insider Preview

So using this we lose the build number, but we get the correct OS version.

Before (See OS section)

distro_shorthand value result
on image
tiny image
* image

After (See OS section)

distro_shorthand value result
on image
tiny image
* image

Features

  • Add Windows 11 support

Issues

  • None

TODO

  • Test those changes in WSL2 using Windows 11.
  • Test those changes in WSL1 using Windows 11.
  • Test those changes in Windows 11 itself (not inside a WSL machine).
  • Test those changes in WSL2 using Windows 10.
  • Test those changes in WSL1 using Windows 10.
  • Test those changes in Windows 10 itself (not inside a WSL machine).

Unfortunatly I cannot perform tests on other WSLs versions, nor in a Windows 10 machine, but I hope someone can ! 🤞

@MrStanDu33 MrStanDu33 changed the title neofetch: Fix windows detection to match version Fix windows detection to match version Apr 2, 2023
@youquzhiji
Copy link

Tested on Windows 10 WSL2

image

image

hykilpikonna added a commit to hykilpikonna/hyfetch that referenced this pull request Apr 4, 2023
… to match version

Upstream PR: dylanaraps/neofetch#2309
Thanks to @MrStanDu33

Co-authored-by: DANIELS-ROTH Stan <[email protected]>
@hykilpikonna
Copy link

Thank you for your contribution!

This PR is merged into hyfetch since this repo (dylanaraps/neofetch) seems no longer maintained.

HyFetch is a fork of neofetch with LGBTQ pride flags, but the repo also maintains an updated version of the original neofetch, addressing many pull requests that are not merged in the original repo.

Read the "Running Updated Original Neofetch" section for more info!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants