reujab / silver

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

Check that $SILVER_SHELL env var ends with supported shell name #19

Closed faokryn closed 4 years ago

faokryn commented 4 years ago

Fixes bug that caused a panic in terminal emulators that return the full path for $0 (e.g. "/bin/bash" instead of "bash") when users set $SILVER_SHELL to $0 as instructed. Also adds a more descriptive panic message.

Closes #16

faokryn commented 4 years ago

My first experience with Rust so if there's a better way to go about this, I'd be happy to learn. This just seemed like a clean way to do it without changing the existing code too much.

reujab commented 4 years ago

The way I would go about this is taking the base file name of $0 with the std::path crate and matching against that (ec19904).

Anyway, thanks for the pull request.