question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handle small terminal sizes with lots of resources to display

See original GitHub issue

Due to the nature of the text rendering, using the cdktf cli for stacks with lots of resources in small terminal windows leads to lots of scrollback and flickering, broken text output.

Essentially, we’ll have to adjust the output size dynamically to the terminal size.

A few ideas:

  • Define a fixed size for our canvas based on the terminal dimensions, and make sure elements exceeding the size won’t be rendered. This would need us to implement some kind of scrolling mechanism
  • Generally reduce dynamic elements shown on the screen, and use static text where possible
  • Calculate canvas size and cut off overflowing elements

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
skorfmanncommented, Apr 12, 2021

Generally reduce dynamic elements shown on the screen, and use static text where possible

I think that’s the only viable option for now.

  • Resources in progress would be displayed “live”
  • Resources which got applied will be rendered as static text above the “live” view
  • When everything is done, we could render a final summary (similar to diff)

To keep it simple, this should be the only behaviour we support for now (so, no dynamic change of rendering modes based on terminal size and resource count). Thoughts?

This could look like this and use static elements

Stack: hello-terra
Done: (a static list)
 ✔ AWS_DYNAMODB_TABLE   helloterra_Hello    aws_dynamodb_table.helloterra_Hello_698
 ✔ AWS_SNS_TOPIC        helloterra_Topic0   aws_sns_topic.helloterra_Topic0_E9AB776
 ✔ AWS_SNS_TOPIC        helloterra_Topic10  aws_sns_topic.helloterra_Topic10_F78BE0
 ✔ AWS_SNS_TOPIC        helloterra_Topic11  aws_sns_topic.helloterra_Topic11_219D04
 ✔ AWS_SNS_TOPIC        helloterra_Topic12  aws_sns_topic.helloterra_Topic12_19C0FD
 ✔ AWS_SNS_TOPIC        helloterra_Topic13  aws_sns_topic.helloterra_Topic13_FE30A3
 ✔ AWS_SNS_TOPIC        helloterra_Topic14  aws_sns_topic.helloterra_Topic14_E676CF
 ✔ AWS_SNS_TOPIC        helloterra_Topic15  aws_sns_topic.helloterra_Topic15_1E2290
 ✔ AWS_SNS_TOPIC        helloterra_Topic16  aws_sns_topic.helloterra_Topic16_64479D

Resources (10 pending / 3 in progress)

 + AWS_SNS_TOPIC        helloterra_Topic17  aws_sns_topic.helloterra_Topic17_5BEE61
 + AWS_SNS_TOPIC        helloterra_Topic18  aws_sns_topic.helloterra_Topic18_FF324C
 + AWS_SNS_TOPIC        helloterra_Topic19  aws_sns_topic.helloterra_Topic19_02E397

I think this would solve the scrollback issue in almost all cases (given that Terraform CLI does 10 operations in parallel by default) and would likely have a very positive impact on the high cpu usage of the CLI as well.

0reactions
github-actions[bot]commented, Nov 28, 2022

I’m going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you’ve found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Looking for X terminal with correct window resize handling
and it gracefully handles detaching from a terminal that's one size (80x24, say) and re-attaching from a terminal of another size (say, 132x50)....
Read more >
Screen sizes and breakpoints - Windows apps - Microsoft Learn
This table describes the different size classes and breakpoints. Responsive design breakpoints. Size class, Breakpoints, Typical screen size ...
Read more >
Screen User's Manual - GNU.org
1 Overview. Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.
Read more >
App resources overview - Android Developers
Resources are the additional files and static content that your code uses, such as bitmaps, layout definitions, user interface strings, ...
Read more >
charmbracelet/bubbletea: A powerful little TUI framework
The fun, functional and stateful way to build terminal apps. A Go framework based on The Elm Architecture. Bubble Tea is well-suited for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found