gyscos / gyscos/cursive

[BUG] While using cursive, stacktrace (on panic) are never printed to (non-alternate) screen

Open
#754 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
4.8k
Forks
270
Avg merge
5d 19h
Merged PRs (30d)
2

Description

**Describe the bug**
Using cursive and a panic comes up (example via a `todo!` or explicit `panic!`) does not show up at all once `.run` has been called and the panic originates from a view

**To Reproduce**
- have the cursive repo cloned
- add `todo!("test")` to example `themed_view` in function `show_dialog` (anywhere in the function) (or any other example)
- run example
- observe no stacktrace, but bad return code

**Expected behavior**
Cursive should exit all screen modes, but not prevent stacktraces / have the stacktraces printed after

**Screenshots**

**Environment**
* Operating system used Linux (manjaro 23.0.0)
* Backend used: ncurses (also tested crossterm)
* Current locale `LANG=en_US.UTF-8`
* Cursive version: crates.io 0.20 AND 5885af0005af753fd76f447a40d19d16bd2acad7

**Additional context**
I have been trying to debug this, but i have not found the cause yet, from what i can tell this problem is backend agnostic (it happens in `ncurses` and `crossterm`) and modifying `Drop` in `crossterm` (while it is used) almost changes nothing, the only thing that changed *something* was to comment-out `LeaveAlternateScreen`, which somehow it still exits the alternate screen (maybe because of my shell or terminal on process exit?) where it has printed the stacktrace, but formatted very badly

using crossterm directly (without cursive) does not result in this problem, when reset via a panic hook

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.