reujab / silver

A cross-shell customizable powerline-like prompt with icons
MIT License
453 stars 30 forks source link

Panic due to unkown shell #16

Closed Rikorose closed 4 years ago

Rikorose commented 4 years ago

Problem under fedora:

$ echo $SILVER_SHELL
/bin/bash

results in

thread 'main' panicked at 'unknown $SILVER_SHELL', src/main.rs:57:18

A possible solution for bash would be to modify in .bashrc:

export SILVER_SHELL="$(basename $0)"

Another option would be to correctly parse the path of $0 in main.

By the way, the error message would be more helpful (i.e. the use does not need to look at the src), if it includes the current value of $SILVER_SHELL and the supported values.

faokryn commented 4 years ago

Noticed this myself. Some additional information: it seems only certain terminal emulators return /bin/bash for $0. So far I've noticed Gnome Terminal, Urxvt, and xTerm return bash while Terminator and Alacritty return /bin/bash. I'm using Fedora 30.