screenFetch icon indicating copy to clipboard operation
screenFetch copied to clipboard

New line causes ascii logo to mess up

Open DRSDavidSoft opened this issue 6 years ago • 10 comments

I'm submitting a

[x] bug report
[ ] new distro request

Version 3.8.0

:: Finding distro...found as 'Cygwin '
:: Finding hostname and user...found as 'David@David-PC'
:: Finding kernel version...found as 'i686 CYGWIN_NT-10.0-WOW 2.11.2(0.329/5/3)'
:: Finding current uptime...found as '4d 4h 54m'
:: Finding current package count...found as '678'
:: Finding current shell...found as 'bash 4.4.12'
:: Finding current resolution(s)...found as '3840x2160'
:: Finding desktop environment...found as 'Modern UI/Metro'
:: Finding window manager...found as 'DWM/Explorer'
:: Finding window manager theme...found as '
Themes
Windows Dark.theme
'
:: Finding GTK2 theme...found as 'Not Found'
:: Finding GTK3 theme...found as 'Adwaita'
:: Finding icon theme...found as 'Not Found'
:: Finding user font...found as 'Consolas'
:: Finding current CPU...found as 'Intel Core i5-4460 @ 4x 3.2GHz'
': Finding current GPU...found as 'NVIDIA GeForce GTX 1080
:: Finding current RAM usage...found as '12159MiB / 20418MiB'

Please notice that window manager theme is a multi-line string:

Themes
Windows Dark.theme

this causes the ascii logo to get messed up: scrf-w10

(in addition to that, notice how ) 64-bit is wrapped up incorrectly)

here's how it should actually look: wscrf

Thanks for creating this awesome tool!

DRSDavidSoft avatar Feb 19 '19 22:02 DRSDavidSoft

@DRSDavidSoft Okay, first of all, that 64-bit wrapping issue is really odd. It might be best to start stripping some of the info we're reporting from the OS string to make it more manageable. Not the first case of that string getting really long.

Second of all, I notice that there's no theme at all in your second image. Is that the correct result from inside cygwin? Actually, is this Cygwin or WSL? I don't think we have WSL detection at the moment.

KittyKatt avatar Oct 09 '19 21:10 KittyKatt

Okay, first of all, that 64-bit wrapping issue is really odd. It might be best to start stripping some of the info we're reporting from the OS string to make it more manageable. Not the first case of that string getting really long.

I actually would suggest breaking it into multiple lines, instead of stripping it!

Either of these will do fine: (Click to show)
David@DAVID-PC
OS: Microsoft Windows 10 Enterprise 64-bit
    (v10.0.17763)
Kernel: ....

or

David@DAVID-PC
OS: Microsoft Windows 10 Enterprise 64-bit
Version: 10.0.17763
Kernel: ....

Second of all, I notice that there's no theme at all in your second image. Is that the correct result from inside cygwin? Actually, is this Cygwin or WSL?

The second screenshot is actually neither Cygwin nor WSL – it's another project written in Powershell. I only used it as a reference here :3

I'm not sure what you mean by "there's no theme at all in your second image." Do you mean the titlebar?

I don't think we have WSL detection at the moment.

It's okay, as I don't intend to use WSL on my machine anytime soon (though I'm sure many others will also appreciate it!)

DRSDavidSoft avatar Oct 10 '19 12:10 DRSDavidSoft

@DRSDavidSoft I'm referring to this, in screenfetch

image

versus this in the powershell project

image

As you can see, there's no "WM Theme:" or a theme detection of any sort available in the second project. Do you think that pulling a "theme" for screenfetch in this instance is even worth it? Is there even a named theme that it can pull?

I'll need to look into the first part. It may require a special treatment of Cygwin/Windows to put that line there as the output for the ASCII is mostly standardized and the other OSes don't currently need or have a "Version: " line.

KittyKatt avatar Oct 10 '19 16:10 KittyKatt

@KittyKatt Oh, I see.

there's no "WM Theme:" or a theme detection of any sort available in the second project. Do you think that pulling a "theme" for screenfetch in this instance is even worth it? Is there even a named theme that it can pull?

I believe any kind of information that screnfetch can extract from the OS and show on the screen is useful, including the WM theme!

In this case:

:: Finding window manager theme...found as '
Themes
Windows Dark.theme
'

The Windows Dark.theme part I believe is referring to the Windows theme file that's currently being used, so I guess it'd worth it to show it to the user, especially if the user loads a custom theme file.

I'll need to look into the first part. It may require a special treatment of Cygwin/Windows to put that line there as the output for the ASCII is mostly standardized and the other OSes don't currently need or have a "Version: " line.

Thank you for that! I can provide Windows testing if required, to hopefully solve these small issues :)

DRSDavidSoft avatar Oct 10 '19 23:10 DRSDavidSoft

image

liyiheng avatar Feb 24 '20 05:02 liyiheng

I solved both these issues locally (Win10/mintty). I commented on the multi-line theme problem on this related issue (caused by output from reg query).

The ") 64-bit" wrapping is because wmic os get version includes \r in the output:

$ wmic os get version | sed 's/\r/<CR>/g; s/ /<space>/g; s/\n/<LF>/g;'
Version<space><space><space><space><space><CR>
10.0.18363<space><space><CR>
<CR>

Line feeds are consumed by the shell, but the carriage return gets into the $distro variable because

distro="$distro (v$(wmic os get version | grep '^10\.' | tr -d ' '))"

leaves the \r at the end, which means the line

mydistro=$(echo -e "$labelcolor OS:$textcolor $distro $sysArch")

has the \r between the $distro and $sysArch variables. I just added \r to the tr -d call:

distro="$distro (v$(wmic os get version | grep '^10\.' | tr -d ' \r'))"

It seems like the other calls to wmic either handle \r or aren't affected by it. In my version (3.9.1), this is line 6245.

almitydave avatar Feb 25 '21 20:02 almitydave

I'm afraid this issue still persists, even in 3.9.1:

$ ./screenfetch-dev --version
screenFetch - Version 3.9.1

DRSDavidSoft avatar Mar 01 '21 19:03 DRSDavidSoft

I need to revisit this soon. Commenting to remind myself.

KittyKatt avatar Mar 19 '21 04:03 KittyKatt

He never did

4310V343k avatar Aug 29 '21 21:08 4310V343k