-
Notifications
You must be signed in to change notification settings - Fork 847
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
(v2) Bubble Tea v2 #1118
Draft
aymanbagabas
wants to merge
364
commits into
main
Choose a base branch
from
v2-exp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
(v2) Bubble Tea v2 #1118
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This implements a wrapper around p.output that locks the output on every write. We also need to redefine `channelHandlers` to be thread-safe since `p.Kill()` can be called from a different thread while the program is running.
…sages and commands
This makes the program keep track of terminal colors so that they get restored on program exit or suspend.
Kitty Keyboard protocol extension also applies to legacy CSI A, CSI B, and others, and CSI ~
b3c76a6
to
3f75169
Compare
This adds support for detecting the terminal's color profile. It adds a new `ColorProfileMsg` message that get sent when the program starts. You can force a specific color profile using the `WithColorProfile` option. When a program requests the `RGB` or `Tc` terminfo capabilities, Bubble Tea will read the response, if there is one, and upgrade the cached color profile and send the new profile to the program again. Supersedes: #1142 Supersedes: #1143
ff9fefb
to
1678d85
Compare
* feat: combine keyboard enhancements into a nicer API This change combines the keyboard enhancements into a nicer API. Kitty keyboard protocol and XTerm modifyOtherKeys are now combined into a single API. This makes it easier to enable keyboard enhancements. Use `WithKeyboardEnhancements` to enable keyboard enhancements. This function accepts a list of `KeyboardEnhancement` functions that can be used to enable different keyboard features. For now, we only support the `WithReleaseKeys` enhancement which enables support for reporting release key events. * Update options.go Co-authored-by: Christian Rocha <[email protected]> * chore: go mod tidy * chore: gofumpt * fix: simplify keyboard enhancements disambiguation * feat: make KeyboardEnhancementsMsg helpers always return true on Windows * fix: remove unused win32input mode * refactor: rename KeyboardEnhancementsMsg methods --------- Co-authored-by: Christian Rocha <[email protected]>
…ter clearing the screen
Fixes: 51536c0 (fix: renderer: make sure to move the cursor to the top left corner after clearing the screen)
This introduces a new `CursorModel` interface that can be implemented by the main model to provide a cursor position and style. A nil cursor will hide the cursor. Otherwise, the cursor will be shown at the position and with the style specified. Use `NewCursor` to quickly create a cursor for a given position with default styles. This method is called in-sync with the `Model.View` method. It also removes the previously introduced `Frame` type and `NewFrame` function. The main model can now return a `string` to render the program's UI. The main model can return a `Cursor` to set the cursor position and style. The old `Init` method is now back and it returns a `Cmd` instead of a both a `Model` and a `Cmd`. This is to make the mental model more straight forward, and to keep things backwards compatible.
Per the latest API.
* feat: renderer: readd standard renderer * Update tea.go Co-authored-by: Christian Rocha <[email protected]> --------- Co-authored-by: Christian Rocha <[email protected]>
This updates the renderer to use backspace to optimize cursor movements when the terminal supports it. This is similar to the hard tabs optimization, but for backspace to move the cursor left.
This adds a new option to set the initial window size of the terminal window. This is useful in testing and required for teatest/v2 after the changes in the renderer. The cell-based cursed renderer heavily relies on the terminal size, and it's important to have a way to set the size manually for tests to run in a non-interactive environment.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will keep track of the changes upcoming in Bubble Tea v2
Init()
return the model