neofetch icon indicating copy to clipboard operation
neofetch copied to clipboard

Neofetch 3.0 shell command broken with /bin/zsh shell

Open iraquitan opened this issue 9 years ago • 12 comments

Description

The neofetch output seems to be broken on the shell command. I'm using Neofetch 3.0 installed through homebrew and using the same config file as in master. My current shell script is as folows:

$ echo $SHELL
/bin/zsh

Neofetch version

Neofetch 3.0

Screenshot

The cropped output: screen shot 2017-01-24 at 08 19 34

if I comment the shell command on config, the output is not cropped: screen shot 2017-01-24 at 08 22 21

Verbose log

The verbose log is found here: http://pastebin.com/sifHL6EJ

Config file

And the config file used here: http://pastebin.com/K2YF33jv

iraquitan avatar Jan 24 '17 12:01 iraquitan

Thanks for opening this. :)

  • Does the issue still occur with neofetch --shell_version off?
  • What's the output of this command?: zsh --version

dylanaraps avatar Jan 24 '17 12:01 dylanaraps

With neofetch --shell_version off the issue is gone. screenshot 2017-01-24 10 02 35

*note: I'm now at work in a different machine, but I had the same issue as in my personal machine.

iraquitan avatar Jan 24 '17 13:01 iraquitan

What's the output of zsh --version? This is the only command that gets run in the shell function, which makes it the only possible cause of the issue.

dylanaraps avatar Jan 24 '17 13:01 dylanaraps

zsh 5.3.1 (x86_64-apple-darwin15.6.0)

iraquitan avatar Jan 24 '17 13:01 iraquitan

Weird.

What about this?

  • "$SHELL" --version

Also what version of bash do you have installed?

  • bash --version

dylanaraps avatar Jan 24 '17 13:01 dylanaraps

I have homebrew zsh installed but not used. Thats why zsh --version is different

$ "$SHELL" --version
zsh 5.0.8 (x86_64-apple-darwin15.0)
$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin15)
Copyright (C) 2007 Free Software Foundation, Inc.

iraquitan avatar Jan 24 '17 13:01 iraquitan

The shell function might include something incompatible with bash 3 and that's why it's suddenly exiting. I'll install bash 3 and see if I can reproduce this.

dylanaraps avatar Jan 24 '17 13:01 dylanaraps

I can reproduce this with bash 3, working on a fix now. :+1:

dylanaraps avatar Jan 24 '17 13:01 dylanaraps

This was the offending line: shell="${shell/ ${SHELL##*/}}", I'm not sure why this caused bash to crash. The issue should be fixed now, try out the latest master and let me know if it still occurs. :)

Edit: Here's the error from bash 3:

bash3: bad substitution: no closing `}' in  ${SHELL##*

Edit2: More digging, this is (probably) a parser bug in bash 3!

Source: http://stackoverflow.com/a/32481879

Edit3: This was also an issue in bash 4.2 and was fixed sometime after.

Source: http://unix.stackexchange.com/questions/137506/how-to-combine-bashs-process-substitution-with-here-document

dylanaraps avatar Jan 24 '17 13:01 dylanaraps

Closing this, reopen it if you're still experiencing the issue. :)

dylanaraps avatar Jan 24 '17 23:01 dylanaraps

Closing this, reopen it if you're still experiencing the issue. :)

I have got the same problem with $SHELL as zsh, it displays properly when $SHELL is /bin/bash

snjy5 avatar May 24 '22 13:05 snjy5

Im still experiencing this issue after a fresh reinstall of ubuntu 22.10

heapframe avatar Dec 24 '22 11:12 heapframe