Skip to content

(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
wants to merge 420 commits into
base: main
Choose a base branch
from
Draft

(v2) Bubble Tea v2 #1118

wants to merge 420 commits into from

Conversation

aymanbagabas
Copy link
Member

@aymanbagabas aymanbagabas commented Aug 28, 2024

This PR will keep track of the changes upcoming in Bubble Tea v2

  • Input sequence parser
  • Kitty keyboard
  • Xterm modifyOtherKeys
  • Mode 2027 (grapheme clustering)
  • Setting/getting terminal background/foreground/cursor colors
  • Setting/getting the clipboard using OSC52
  • Make Init() return the model
  • New Key/Mouse API (v2) Use KeyMsg/MouseMsg interfaces #1111

@aymanbagabas aymanbagabas changed the title V2 exp (v2) Bubble Tea API Aug 28, 2024
@aymanbagabas aymanbagabas added this to the v2.0.0 milestone Aug 29, 2024
@aymanbagabas aymanbagabas force-pushed the v2-exp branch 7 times, most recently from d2bffc5 to 84b68c5 Compare September 20, 2024 20:09
aymanbagabas and others added 19 commits October 16, 2024 16:53
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.
meowgorithm and others added 30 commits February 21, 2025 09:12
* 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]>
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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants