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 543 commits into
base: main
Choose a base branch
from
Draft

(v2) Bubble Tea v2 #1118

wants to merge 543 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 18 commits January 13, 2025 08:20
Without this, keyboard enhancements events won't be sent to update
…ements

This change exposes the `KeyboardEnhancements` type and tracks requested
and active enhancements in the `Program` struct. This change also
renames the `KeyboardEnhancement` type to `KeyboardEnhancementOption`
and `keyboardEnhancements` to `KeyboardEnhancements` as well as
`EnableKeyboardEnhancements` to `RequestKeyboardEnhancements`.
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This implements the new cursed ferocious renderer. This is based on the
new `cellbuf.Screen` renderer. This renderer is more efficient and
flexible than the previous renderer.

The renderer controls the altscreen buffer and cursor visibility which
means we don't need to do so in Bubble Tea. Instead, Bubble Tea can
focus on the event loop and the application state.

This also removes the experimental flags and changes the renderer
interface to be more explicit about the methods that are available.
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
…sted and active enhancements (#1286)

refactor: keyboard: expose type and track requested and active
enhancements

This change exposes the `KeyboardEnhancements` type and tracks requested
and active enhancements in the `Program` struct. This change also
renames the `KeyboardEnhancement` type to `KeyboardEnhancementOption`
as well as`EnableKeyboardEnhancements` to `RequestKeyboardEnhancements`.



Fixes: #1283
Copy link

codecov bot commented Jul 17, 2025

Codecov Report

Attention: Patch coverage is 46.22951% with 656 lines in your changes missing coverage. Please review.

Project coverage is 47.66%. Comparing base (e24d6b2) to head (5ba56e2).
Report is 28 commits behind head on main.

Files with missing lines Patch % Lines
tea.go 54.24% 197 Missing and 35 partials ⚠️
cursed_renderer.go 64.77% 99 Missing and 13 partials ⚠️
input.go 8.77% 52 Missing ⚠️
standard_renderer.go 0.00% 45 Missing ⚠️
keyboard.go 17.94% 32 Missing ⚠️
tty.go 51.51% 23 Missing and 9 partials ⚠️
mouse.go 0.00% 21 Missing ⚠️
color.go 33.33% 20 Missing ⚠️
nil_renderer.go 0.00% 20 Missing ⚠️
renderer.go 0.00% 20 Missing ⚠️
... and 13 more
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1118       +/-   ##
===========================================
- Coverage   70.10%   47.66%   -22.45%     
===========================================
  Files          17       26        +9     
  Lines        1726     2031      +305     
===========================================
- Hits         1210      968      -242     
- Misses        469      989      +520     
- Partials       47       74       +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

if p.requestedEnhancements.modifyOtherKeys > 0 {
// XXX: Tmux has added support for Xterm modifyOtherKeys, but it
// is not enabled by default and when enabled, it can cause
// issues with some keys like escape and typeing.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// issues with some keys like escape and typeing.
// issues with some keys like escape and typing.

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.

8 participants