reujab / silver

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

silver error #48

Closed webkernel closed 3 years ago

webkernel commented 3 years ago

I followed instructions and after checking with source <(silver init) :

thread 'main' panicked at 'invalid argument, ', /home/webkernel/.cargo/registry/src/github.com-1ecc6299db9ec823/silver-1.1.0/src/print.rs:11:13 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace $(git_prompt_string)

thecaralice commented 3 years ago

Show your shell config (.bashrc, .zshrc etc.)

thecaralice commented 3 years ago

Oof, can you send it as a file/gist/etc.?

thecaralice commented 3 years ago

Also you should call source <(silver init) in your .zshrc and I see you are setting PROMPT and RPROMPT, they might conflict

thecaralice commented 3 years ago

Did you install silver from crates.io or from git?

webkernel commented 3 years ago

I installed with cargo install silver

thecaralice commented 3 years ago

Try cargo install --git https://github.com/reujab/silver.git

webkernel commented 3 years ago

Just installed with cargo install --git https://github.com/reujab/silver.git

Now I have a different error:

thread 'main' panicked at 'unknown $SILVER_SHELL: "". Supported shells: bash, zsh, fish, powershell', src/main.rs:65:18 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

thecaralice commented 3 years ago

Do you have SILVER_SHELL set?

webkernel commented 3 years ago

Besides Rust and silver install all I have is this on .zshrc

SILVER_LEFT=(dir:blue:black git:green:black) SILVER_RIGHT=(status:white:black cmdtime:magenta:black env:green:black:SILVER_SHELL) export SILVER_SHELL=zsh

thecaralice commented 3 years ago

smh silver is not able to see your SILVER_SHELL. Try renaming your .zshrc to .zshrc.bak so it's not sourced and create a new .zshrc with

SILVER_LEFT=(dir:blue:black git:green:black)
SILVER_RIGHT=(status:white:black cmdtime:magenta:black env:green:black:SILVER_SHELL)
export SILVER_SHELL=zsh
source <(silver init)

then restart terminal

webkernel commented 3 years ago

Great! It works. Many thanks!

thecaralice commented 3 years ago

Then the issue is in .zshrc.bak, maybe some other prompt conflicting with silver or weird zsh settings