Skip to content
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

adds Program.Write method #268

Closed
wants to merge 1 commit into from
Closed

adds Program.Write method #268

wants to merge 1 commit into from

Conversation

tgirod
Copy link

@tgirod tgirod commented Mar 26, 2022

This method gives access to Program.output so one can write directly to the terminal's output.

Use case

Your app is not fullscreen, and you want to print out some stuff to the terminal while the application is running.

You can do so by using fmt.Println, but looking at bubbleatea's code, there is a mutex for accessing Program.output. So this method politely grabs the mutex before trying to write to Program.output.

Considerations

Maybe we don't want tea.Program to implement the Writer interface - in which case the method can be renamed to something else.

@tgirod tgirod mentioned this pull request Mar 26, 2022
@meowgorithm
Copy link
Member

Closing in favor of #179, as mentioned in #267.

@tgirod tgirod deleted the output_access branch March 27, 2022 12:35
@meowgorithm
Copy link
Member

Just a note that this functionality is now available in master and will be available in the next release. For details see #249.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants