dylanaraps / neofetch

🖼️ A command-line system information tool written in bash 3.2+
MIT License
22.18k stars 1.66k forks source link

neofetch hangs trying to load "shell" line when remoted into Windows 11 over openSSH #2053

Open deltamualpha opened 2 years ago

deltamualpha commented 2 years ago

Description

When running in Powershell 7 when connected over OpenSSH on Windows 11, neofetch hangs during what I assume is an attempt to determine what shell it's running under. Same behavior seen in default cmd shell as well.

neofetch is installed in this case using scoop.

Also, when run locally on the machine, the shell is misidentified as Bash, instead of Powershell 7.

Neofetch version

7.1.0

Screenshot

Remote:

Screen Shot 2022-02-13 at 10 42 29 PM

Local:

Screen Shot 2022-02-13 at 10 44 12 PM

Config file

Verbose log

https://gist.github.com/deltamualpha/3b2e03cda1ab358eb1bcefeeb0976dd2

deltamualpha commented 2 years ago

Aha, found the logged output. Attached what appears to be the relevant part here: https://gist.github.com/deltamualpha/3b2e03cda1ab358eb1bcefeeb0976dd2

whentojump commented 2 years ago

I had similar issues. I found that the core problem is: when SSH'ing into a Windows machine, Git Bash will somehow get a different $SHELL than the local case.

Here is my output:

Local:

$ echo $SHELL
/usr/bin/bash

Remote:

$ echo $SHELL
/c/windows/system32/windowspowershell/v1.0/powershell.exe

(Note: mine is PowerShell rather than CMD like in OP, because I did set it so, as the Windows "login shell", guided by this document)

Since neither PowerShell or CMD supports --version, things will go unexpectedly.

I don't know what a long-term solution could be, but a quick fix is: in config.conf, change this line to:

shell_version="off"
deltamualpha commented 2 years ago

Good catch! For me, it would still hang until I just commented out the Shell line entirely. I wonder if it's trying to launch a subshell by accident?