You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a tool that has a dry run or plan mode. This dry run mode can print out quite a few lines depending on the number of changes it will perform (think similar to Terraform output).
I'd like the end result to look something like this:
✓ Loaded state
# ...plan details...
150 things to do
I've found 2 ways to go about printing out this plan, both seem flawed:
Use Program.Printf()
Create a "static text" model
The problem with 1 is any components that were rendered before I use Printf as actual Models are moved below the text. So for example, you may see something like
# ...plan details...
150 things to do
✓ Loaded state
The above example doesn't look terrible, but it's a little more confusing for my usecase.
For 2, it appears that bubbletea trims the output to the height of the terminal. So if the terminal can only display 10 lines, you'll only ever see the last 10 lines of the plan.
So what would be the recommended way to handle the above?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to create a tool that has a dry run or plan mode. This dry run mode can print out quite a few lines depending on the number of changes it will perform (think similar to Terraform output).
I'd like the end result to look something like this:
I've found 2 ways to go about printing out this plan, both seem flawed:
Program.Printf()
The problem with 1 is any components that were rendered before I use
Printf
as actual Models are moved below the text. So for example, you may see something likeThe above example doesn't look terrible, but it's a little more confusing for my usecase.
For 2, it appears that bubbletea trims the output to the height of the terminal. So if the terminal can only display 10 lines, you'll only ever see the last 10 lines of the plan.
So what would be the recommended way to handle the above?
Beta Was this translation helpful? Give feedback.
All reactions