• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

charmbracelet / bubbletea / 12938215461
50%
main: 72%

Build:
Build:
LAST BUILD BRANCH: windows-fkeys
DEFAULT BRANCH: main
Ran 23 Jan 2025 09:16PM UTC
Jobs 1
Files 25
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Jan 2025 09:16PM UTC coverage: 58.077%. First build
12938215461

Pull #1118

github

web-flow
chore: merge: feat: add Frame type and remove cursor commands (#1295)

This commit introduces a new `Frame` type that represents a single frame
of the program's output. The `Frame` type contains the frame's content
and cursor settings. The cursor settings include the cursor's position,
style, blink, and visibility.

It also removes the cursor commands from the `tea` package. The cursor
commands are now part of the `Frame` type. The cursor commands were
removed because they were not idiomatic and were not flexible enough to
support additional cursor settings.

API:
```go
// Model contains the program's state as well as its core functions.
type Model interface {
	// Init is the first function that will be called. It returns an optional
	// initial command. To not perform an initial command return nil.
	Init() (Model, Cmd)

	// Update is called when a message is received. Use it to inspect messages
	// and, in response, update the model and/or send a command.
	Update(Msg) (Model, Cmd)

	// View renders the program's UI, which is just a [fmt.Stringer]. The view
	// is rendered after every Update.
	// The main model can return a [Frame] to set the cursor position and
	// style.
	View() fmt.Stringer
}

// Cursor represents a cursor on the terminal screen.
type Cursor struct {
	// Position is a [Position] that determines the cursor's position on the
	// screen relative to the top left corner of the frame.
	Position Position

	// Color is a [color.Color] that determines the cursor's color.
	Color color.Color

	// Shape is a [CursorShape] that determines the cursor's style.
	Shape CursorShape

	// Blink is a boolean that determines whether the cursor should blink.
	Blink bool
}

// NewCursor returns a new cursor with the default settings and the given
// position.
func NewCursor(x, y int) *Cursor {
	return &Cursor{
		Position: Position{X: x, Y: y},
		Color:    nil,
		Shape:    CursorBlock,
		Blink:    true,
	}
}

// Frame represents a single frame of the progr... (continued)
Pull Request #1118: (v2) Bubble Tea API

478 of 921 new or added lines in 23 files covered. (51.9%)

888 of 1529 relevant lines covered (58.08%)

21.68 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
65.96
commands.go
1
19.23
tty_unix.go
2
84.62
sync.go
3
0.0
cursor.go
3
0.0
xterm.go
4
0.0
raw.go
4
88.1
screen.go
4
0.0
termcap.go
6
70.0
environ.go
11
21.43
frame.go
13
35.0
clipboard.go
13
0.0
nil_renderer.go
13
75.29
options.go
14
0.0
key.go
20
0.0
renderer.go
22
60.0
tty.go
24
38.46
keyboard.go
26
33.33
color.go
26
0.0
mouse.go
36
76.62
cursed_renderer.go
51
7.27
input.go
146
63.69
tea.go
Jobs
ID Job ID Ran Files Coverage
1 12938215461.1 23 Jan 2025 09:16PM UTC 25
58.08
GitHub Action Run
Source Files on build 12938215461
  • Tree
  • List 25
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #1118
  • Next Build on v2-exp (#12995036272)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc