kamiyaa / joshuto

ranger-like terminal file manager written in Rust
https://crates.io/crates/joshuto
GNU Lesser General Public License v3.0
3.47k stars 154 forks source link

[BUG] Fatal crash when I return to joshuto from a shell #518

Open Beethoven-n opened 7 months ago

Beethoven-n commented 7 months ago

this is hard to explain conversationally so i'll try laying it out

What's the bug?

If I run :shell zsh to start a shell session wherever I'm at, then do certain commands, I get this error:

thread 'main' panicked at src/ui/backend.rs:80:32:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It's testable with sudo -s, but I noticed it happening with lessc, so it can't just be involved with sudo.

How do I replicate it?

  1. Start joshuto
  2. do :shell <whatever shell you like>
  3. do sudo -s, then hit Ctrl-D twice to exit out of both the root shell and the shell joshuto spawned
  4. observe error

Context

Linux version: 6.8.2-arch2-1 joshuto --version output:

joshuto-0.9.8
branch:main
commit_hash:a103c886
build_time:2024-03-31 23:55:15 +00:00
build_env:rustc 1.77.1 (7cf61ebde 2024-03-27),stable-x86_64-unknown-linux-gnu

AUR package version: r1343.a103c88-1 Cargo version: 1.77.1

Akmadan23 commented 7 months ago

This should be fixed by #515.

Beethoven-n commented 7 months ago

can you reproduce the crash on your branch?

Akmadan23 commented 7 months ago

I reproduced it on the main branch, whereas on the patched branch joshuto displays the exit code of the shell and keeps going instead of crashing.

Beethoven-n commented 7 months ago

with the merge, it's fixed! bit of a note though, now it displays the exit code of the program. might have to fix that on my end for my use case but it sounds useful for pretty much every other case