-
Notifications
You must be signed in to change notification settings - Fork 886
(v2) Bubble Tea v2 #1118
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
Draft
aymanbagabas
wants to merge
420
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
d2bffc5
to
84b68c5
Compare
Right now, we only have one experimental feature to use the new cell buffer as a default renderer. Use `TEA_EXPERIMENTAL=cellbuf` environment variable to enable the use of the cell buffer as the default renderer.
…hanges This implements the meat of the cell renderer. It performs rendering changes using a cell-based tracking. Changed cells are marked as dirty and only the changed cells are rendered to the terminal. This is more efficient than line rendering.
This commit changes the behavior of grapheme clustering to be opt-in instead of opt-out. This is because some terminals like Apple Terminal don't support DECRQM and DECRPM, which are required for querying and setting the grapheme clustering state. Apple Terminal, instead, replies with a `p` character when querying the grapheme clustering state, which is not a valid response and breaks the program output.
Before initializing the input reader, we need to ensure that the console input buffer is empty, otherwise, we can get dangling events from previous sessions.
We need to reset the cursor when at phantom cell i.e. outside the screen, otherwise, the cursor position will be out of sync.
…mes (#1205) * chore: use verbs in background, foreground, and window request cmd names This renames a few existing commands to make it clearer that the user is firing off a task. * WindowSize -> RequestWindowSize * ForegroundColor -> RequestForegroundColor * BackgroundColor -> RequestBackgroundColor It also expands on a few comments, and provides examples. * fix: screen tests * fix(examples): use RequestWindowSize instead of WindowSize --------- Co-authored-by: Ayman Bagabas <[email protected]>
* fix: cellrenderer: we need to repaint after clearing the screen * fix: cellrenderer: reset cursor when at phantom cell wip * feat: cellrenderer: support setting cursor position * fix: use x and y instead of row and column for CursorPositionMsg This means we're now 0-indexed, which is consistent with the rest of the library.
* fix: windows: enable mouse mode on demand This fixes an issue where mouse mode is always enabled on Windows. With this patch, we enable mouse events only it is requested. Needs: charmbracelet/x#386 Related: #1313 * refactor: mouse: properly handle mouse mode Since mouse mode has a special case on Windows, we now have separate msg types for mouse events. * chore: go mod tidy
Signed-off-by: Carlos Alexandro Becker <[email protected]>
Signed-off-by: Carlos Alexandro Becker <[email protected]>
Signed-off-by: Carlos Alexandro Becker <[email protected]>
This is a quick example illustrating how to enable keyboard enhancements. <img width="607" alt="image" src="https://github.com/user-attachments/assets/023a244a-cc34-4370-b115-ad7b4108322b" />
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
MakeInit()
return the model