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

Altscreen enter and exit messages #49

Closed
meowgorithm opened this issue Feb 4, 2021 · 7 comments
Closed

Altscreen enter and exit messages #49

meowgorithm opened this issue Feb 4, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@meowgorithm
Copy link
Member

meowgorithm commented Feb 4, 2021

Right now the only way to enter and exit the altscreen (full window mode) is via Program.EnterAltScreen() and Program.ExitAltScreen(). This means that, without employing hacks, one can only enter and exit when starting and quitting programs. It probably makes sense to have library-level commands, similar to tea.Quit, for entering and exiting the altscreen to give Bubble Tea programs the opportunity to jump in and out of the altscreen in-program.

@meowgorithm meowgorithm added the enhancement New feature or request label Feb 27, 2021
@kiyonlin
Copy link
Contributor

kiyonlin commented Mar 7, 2021

This is a good idea. So we should provide 2 Msg tea.EnterAltScreen and tea.ExitAltScreen. User can trigger them in Update if they want to change the alt screen mode.

I think I can submit a PR if you haven't done this.

@meowgorithm
Copy link
Member Author

That would be awesome, @kiyonlin. Please do feel free to submit a PR. I’d probably call them tea.EnterAltScreenMsg and tea.ExitAltScreenMsg for naming consistency (like tea.KeyMsg and tea.WindowSizeMsg).

@meowgorithm
Copy link
Member Author

meowgorithm commented Mar 7, 2021

Actually, @kiyonlin, there’s a branch I should merge before you do this. I’ll do that in a few minutes and let you know when it’s in.

@kiyonlin
Copy link
Contributor

kiyonlin commented Mar 7, 2021

Dw, I will do it tomorrow (9 hours later) 😃

@meowgorithm
Copy link
Member Author

@kiyonlin Alright, go for it. There are some small changes in how the alt screen is set in #61 (just merged) but it shouldn't change your implementation.

@meowgorithm
Copy link
Member Author

Oh, just one more thought: realizing we'll also need two commands in addition to messages which I'd probably call tea.EnterAltScreen and tea.ExitAltScreen.

@meowgorithm
Copy link
Member Author

This has been merged and was released in v0.13.0.

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

No branches or pull requests

2 participants