reujab / silver

A cross-shell customizable powerline-like prompt with icons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

silver init doesn't recognize login shells (e.g. "-bash", "-su")

zackw opened this issue · comments

silver init looks up the name of its parent process (or, in older versions, at the value of the SILVER_SHELL environment variable, which you're expected to set to $0, which comes to the same thing) and uses that to decide what type of shell is running.

If the parent process is a login shell (e.g. invoked by /usr/bin/login when you log in on a text console, or by sshd when you log in remotely) then the parent process will have a dash prepended to its name (e.g. -bash instead of bash). silver does not recognize this convention and will print a panic message to the effect of "unknown shell: -bash; supported shells: ..."

silver init should trim a leading dash from the shell variable before matching on it.

[N.B. with some implementations of su it's possible for you to get "-su" as the name of the login shell. Rather than trying to deduce the actual identity of the shell from other clues I would suggest restoring the SILVER_SHELL environment variable and treating it as a way for the user to override silver's idea of the shell in use; when it's set, don't muck around with sysinfo at all.]