tokio-rs / console

a debugger for async rust!
MIT License
3.52k stars 138 forks source link

Max Width Restriction? #577

Open AlJohri opened 1 month ago

AlJohri commented 1 month ago

What crate(s) in this repo are involved in the problem?

tokio-console

What is the issue?

The issue is that there appears to be some maximum width restriction preventing me from zooming out far enough to see the full text in the rightmost column.

Screenshot 2024-07-28 at 8 54 00 AM

How can the bug be reproduced?

https://github.com/user-attachments/assets/e99e4810-6566-45ed-9ec2-3c09181f3876

You can reproduce the bug by pressing CMD and - repeatedly. A few times the width of the tokio-console will adjust properly. But after pressing it enough times, it will stop adjusting and stay at some maximum width.

Logs, error output, etc

No response

Versions

❯ cargo tree | grep console-                            
│   ├── console-subscriber v0.3.0
│   │   ├── console-api v0.7.0
├── console-subscriber v0.3.0 (*)
├── console-subscriber v0.3.0 (*)

Possible solution

No response

Additional context

No response

Would you like to work on fixing this bug?

yes

hds commented 1 month ago

After talking to the Ratatui devs, it looks like this is a limitation in Ratatui (and perhaps also in the underlying terminal library). The dimensions (height and width) are stored as u16 and that effectively restricts the total area that is rendered to a u16 as well.

This isn't intentional, but it isn't clear what the correct solution is. I didn't manage to find an issue on the Ratatui project, but I was given this comment as a reference: https://github.com/ratatui-org/ratatui/issues/174#issuecomment-2241499950

It was suggested that providing some sort of notification when the terminal is larger than the limit, but I'm not entirely sure how to achieve that right now.