Comments (4)
FWIW I've tested Gnome-Terminal and tilix (both are VTE-based).
from tui-rs.
Moreover, if I just replace chunks[2]
with chunks[1]
sometimes I see this panic:
thread 'main' panicked at 'attempt to add with overflow', /home/xav/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.2.0/src/layout.rs:57:9
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::print
at /checkout/src/libstd/sys_common/backtrace.rs:68
at /checkout/src/libstd/sys_common/backtrace.rs:57
2: std::panicking::default_hook::{{closure}}
at /checkout/src/libstd/panicking.rs:381
3: std::panicking::default_hook
at /checkout/src/libstd/panicking.rs:397
4: std::panicking::rust_panic_with_hook
at /checkout/src/libstd/panicking.rs:577
5: std::panicking::begin_panic
at /checkout/src/libstd/panicking.rs:538
6: std::panicking::begin_panic_fmt
at /checkout/src/libstd/panicking.rs:522
7: rust_begin_unwind
at /checkout/src/libstd/panicking.rs:498
8: core::panicking::panic_fmt
at /checkout/src/libcore/panicking.rs:71
9: core::panicking::panic
at /checkout/src/libcore/panicking.rs:51
10: tui::layout::Rect::right
at /home/xav/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.2.0/src/layout.rs:57
11: tui::widgets::Widget::background
at /home/xav/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.2.0/src/widgets/mod.rs:54
12: <tui::widgets::block::Block<'a> as tui::widgets::Widget>::draw
at /home/xav/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.2.0/src/widgets/block.rs:107
13: <tui::terminal::Terminal<B>>::render
at /home/xav/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.2.0/src/terminal.rs:103
14: tui::widgets::Widget::render
at /home/xav/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.2.0/src/widgets/mod.rs:65
15: endmic::draw::{{closure}}
at src/main.rs:361
16: tui::layout::Group::render
at /home/xav/.cargo/registry/src/github.com-1ecc6299db9ec823/tui-0.2.0/src/layout.rs:330
17: endmic::draw
at src/main.rs:352
18: endmic::main::run
at src/main.rs:344
19: endmic::main
at ./<main macros>:14
20: std::rt::lang_start::{{closure}}
at /checkout/src/libstd/rt.rs:74
21: std::panicking::try::do_call
at /checkout/src/libstd/rt.rs:59
at /checkout/src/libstd/panicking.rs:480
22: __rust_maybe_catch_panic
at /checkout/src/libpanic_unwind/lib.rs:101
23: std::rt::lang_start_internal
at /checkout/src/libstd/panicking.rs:459
at /checkout/src/libstd/panic.rs:365
at /checkout/src/libstd/rt.rs:58
24: std::rt::lang_start
at /checkout/src/libstd/rt.rs:74
25: main
26: __libc_start_main
27: _start
from tui-rs.
Thanks for the complete bug report. After some research, the problem is linked to the library used to compute the layout. When i'm getting the results back, the height of the second chunk is either 0 or a negative value which converted back to an unsigned integer leads to an overflow in latter computations (and thus the panic you exhibited). This kind of behavior seems to happen only when min and max constraints are mixed together. I fixed the panic and change the documentation to advertise a more reliable solution for the moment. However, I will certainly need more time to fix the root of the instability.
from tui-rs.
OK thanks.
from tui-rs.
Related Issues (20)
- How to use different styles for a text object?
- How about another style of paragraph wrapping? HOT 1
- Is there a way of modifying individual cells?
- Shell command line and/or/pipeline cause tui not showing properly HOT 2
- Is there a way to update a `Paragraph`? HOT 2
- Is there a way to use embedded ANSI from a string? HOT 1
- Rendering empty Paragraph panics HOT 2
- Empty lines (containing "") are hidden in List output HOT 1
- Multiple selections in a Table HOT 1
- demo deosnt seems to be self contained,build have error could nt found main functions HOT 1
- confused at how to compile and test the demo HOT 2
- Border top with title should render border on the left side
- Better scroll view HOT 1
- Support drawing a portion of the screen
- Get the line number of a string in a paragraph
- Generic state trait
- Using min and max constraints together results in inconsistent (random) layout. HOT 1
- The "intersects" function caused an integer overflow error. HOT 2
- README should say that tui is unmantained and ratatui is the maintained fork HOT 1
- Detecting overflow panic.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tui-rs.