reujab / silver

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

silver's dir block panics when the folder current working directory gets deleted #25

Closed dcermak closed 4 years ago

dcermak commented 4 years ago

The directory block panics when the current working directory gets deleted:

$ grep -i silver .bashrc
export SILVER_SHELL=bash
SILVER=(user:green:black dir:blue:black git:green:black:yellow virtualenv:white:black time:5e8d87:black status:red:black)
eval "$(silver init)"
dan@Boreas  /tmp  9:12PM  mkdir -p test && cd test/
dan@Boreas  /tmp/test  9:13PM  rmdir /tmp/test
dan@Boreas  /tmp/test  9:13PM  ll
total 0
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

My main issue here is not the panic per-se, but that you end up with a non-functioning shell. In "vanilla" bash you can still cd into an existing directory, but with the silver prompt active you have to kill the current shell.

Nevertheless, still an awesome prompt: 10/10 will continue to use it ;-)

reujab commented 4 years ago

Thanks for opening. I'll take a look at it tomorrow.

On Mon, Mar 2, 2020 at 3:19 PM Dan Čermák notifications@github.com wrote:

The directory block panics when the current working directory gets deleted:

$ grep -i silver .bashrc export SILVER_SHELL=bash SILVER=(user:green:black dir:blue:black git:green:black:yellow virtualenv:white:black time:5e8d87:black status:red:black) eval "$(silver init)" dan@Boreas  /tmp  9:12PM  mkdir -p test && cd test/ dan@Boreas  /tmp/test  9:13PM  rmdir /tmp/test dan@Boreas  /tmp/test  9:13PM  ll total 0 thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.

My main issue here is not the panic per-se, but that you end up with a non-functioning shell. In "vanilla" bash you can still cd into an existing directory, but with the silver prompt active you have to kill the current shell.

Nevertheless, still an awesome prompt: 10/10 will continue to use it ;-)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/reujab/silver/issues/25?email_source=notifications&email_token=AFVAMZUVW4OZTOPJMZLCI7DRFQIF7A5CNFSM4K733ZH2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IRZ6CCA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFVAMZRZBLIN2FKSPLSX5D3RFQIF7ANCNFSM4K733ZHQ .