-
Notifications
You must be signed in to change notification settings - Fork 738
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't redirect output of non-interactive application #618
Comments
It’s overkill at the moment, but I might expand on bubbletea in the future. So you don’t have an idea of why that happens? |
Hey @tim-hilt we implemented a This is a working example, but it works with hyperfine x Bubble Tea https://gist.github.com/bashbunni/f79665e45e3ace35b344cbd6bd2442dd of course it's not perfect, but the functionality you're looking for is working here. Just did the minimal edits required from the example above |
Hey @bashbunni and thanks for your response. I think what I’m looking for got lost in translation. I have a bubbletea application that has no interactive elements. It‘s only there to print a table. I would want to time how long it takes to run the command to completion. You can see how I start the bubbletea process here: https://github.com/tim-hilt/tempo/blob/main/cli/tablecomponent/tablecomponent.go#L42 |
Hey @tim-hilt, haha no problem. I'm not really understanding what you're trying to do. You've got a table being output... Are you trying to count how long it takes for the bubble tea program to start up or the duration of some other terminal command that gets triggered by some keypress after the table prints? |
@bashbunni I implemented a minimal reproducable example. To run it enter the following: git clone git@github.com:tim-hilt/bubbletea-redirection-showcasing.git && cd bubbletea-redirection-showcasing && go mod download && go run main.go you should see the table printed to the screen. The command exits afterwards. Now try again with go run main.go > /dev/null you should see the command blocking forever, which is not what I'd expect. I'd expect the program to run without output and exit afterwards. |
Don't use |
Ok, then try the following: go build && ./bubbletea-redirection-showcasing > /dev/null it blocks for me. |
Hey @tim-hilt, I think what's happening here is your Normally, there's always one message for Changing the |
@mcastorina We typically do a final render before quitting. It would also do a render before executing the commands you provide. That's why in this case it would be rendering twice total |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I use bubbletea for the sole purpose of generating and printing a table in my application. So no interactive features there (until now!). I expected, that I could perform a benchmark-measurement with hyperfine, however it seems like execution is blocked in this case, because hyperfine redirects stdout and stderr.
Sure enough, if I redirect the output of my program to
> /dev/null
, then my program never exits.Is this something I can solve by writing my application in a different way? Is this a bug with bubbletea?
The text was updated successfully, but these errors were encountered: