Commit graph

38 commits

Author SHA1 Message Date
Hsn
33f6a40ec0
docs: fix command and environment godoc examples (#1833) 2026-10-02 13:30:47 +04:00
Ayman Bagabas
faa0b9c36b
fix: lint issues 2026-02-23 23:15:30 +03:00
Ayman Bagabas
bd747e7bfa
refactor: clean up redundant code and update testdata 2025-10-01 13:50:38 -04:00
Ayman Bagabas
9ef921ab1f
Merge branch 'main' into v2-exp 2025-08-07 11:21:53 -04:00
Joe Henke
c76509a9d4
fix: compact sequences like batches (#958) 2025-08-07 11:19:00 -04:00
Carlos Alexandro Becker
efeb3ffa5c
fix: make RequestWindowSize a command (#1330) 2025-02-13 11:36:20 -05:00
Christian Rocha
3bd4650254
chore: use verbs in background, foreground, and window request cmd names (#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 <ayman.bagabas@gmail.com>
2024-10-28 13:38:27 -04:00
Ayman Bagabas
265996c29b
docs: update godoc examples to return model in Init 2024-09-19 13:22:37 -04:00
Ayman Bagabas
a7d49d01a4
chore: remove deprecated 2024-09-19 13:21:00 -04:00
Ayman Bagabas
7cb34becaf
(v2) feat: combine keyboard enhancements into a nicer API (#1152)
* 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 <christian@rocha.is>

* 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 <christian@rocha.is>
2024-09-18 14:23:47 -04:00
Ayman Bagabas
4d2072bfec
fix: kitty: request protocol flags and rename flag methods 2024-08-15 14:45:15 -04:00
Ayman Bagabas
7d708384a1
feat: add a cmd to request window size (#988)
* feat: add a cmd to request window size

Fixes: https://github.com/charmbracelet/bubbletea/issues/987#issuecomment-2068452658

* Update commands.go

Co-authored-by: Christian Rocha <christian@rocha.is>

---------

Co-authored-by: Christian Rocha <christian@rocha.is>
2024-07-16 12:56:15 -04:00
Carlos Alexandro Becker
0c937f47b8
fix: stop and drain timers (#993)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-03 09:23:29 -03:00
Andrés Taylor
305d5b285f
chore: optimize batches with one item (#875)
Signed-off-by: Andres Taylor <andres@planetscale.com>
2024-03-01 14:18:47 -05:00
Ayman Bagabas
2bcb0af2e2
feat: add set-window-title command (#611)
Set the terminal window title using termenv.

Fixes: https://github.com/charmbracelet/bubbletea/issues/610
2023-12-04 11:50:27 -05:00
Christian Rocha
ffad6555d5 chore(lint): add various nolint directives, where appropriate 2023-07-10 09:04:25 -04:00
Martin Dosch
2d10416631 [codespell]: Fix typos. 2022-11-03 12:55:31 -04:00
treilik
918d35746b feat: export BatchMsg
There's no good reason to keep it private. Exporting it helps
testability, debugging, and allows for a few special model.Update
implementations.
2022-10-22 22:51:46 +02:00
Josh Soref
4aa9ce489b
docs: fix spelling / various typos (#526) 2022-10-11 14:40:01 +02:00
Christian Muehlhaeuser
8d6bdcf2fd chore: reorganize command helpers 2022-10-04 05:29:41 +02:00
Leandro López
7cf0d54bd4
docs: fix typo in Tick godoc (#477) 2022-10-04 04:14:42 +02:00
Christian Rocha
989d49f3e6 feat: add Sequence for running commands in order. Closes #413.
This deprecates Sequentially.
2022-08-30 13:07:05 -07:00
Christian Muehlhaeuser
1e1b5f716d chore: gofmt sources 2022-08-15 12:25:55 +02:00
Carlos Alexandro Becker
97050569c9
docs: improve godoc on tick and every (#320)
* docs: improve godoc on tick and every

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* docs: small improvements

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* docs: add loop examples for Tick/Every in GoDocs

* docs: small wording adjustments

* docs: small copy edits

Co-authored-by: Christian Rocha <christian@rocha.is>
2022-05-29 21:40:57 -03:00
Ajeet D'Souza
7d18632ca5
fix: handle nil cmds in tea.Sequentially (#214) 2022-02-01 22:52:49 -03:00
Carlos Alexandro Becker
a0c6074bbb Add a tea.Sequentially command
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-01-17 13:14:40 -05:00
Christian Rocha
d1c791be98
Fix another typo in a comment 2020-10-12 10:59:36 -04:00
Christian Rocha
7efa31996d
Fix a typo in a comment 2020-10-12 10:57:06 -04:00
kiyon
780db1e32f fix typo 2020-10-12 02:34:16 +02:00
Christian Rocha
6fcdf9908f
Improve examples in docs 2020-07-30 11:30:33 -04:00
Christian Rocha
6bd34bdd14
Remove commands for manually getting terminal size; no longer needed
Tea core now sends the terminal dimensions on start and when the window
is resized (except on Windows where SIGWINCH, the resize signal, is not
supported).
2020-06-18 22:47:17 -04:00
Christian Rocha
5ccb786eec
Um, the package is called Bubble Tea, thank-you-very-much 2020-06-11 19:34:08 -04:00
Christian Rocha
55a8d1853e
Comments 2020-06-08 12:48:57 -04:00
Christian Rocha
3b8b011b5a
Rename to Bubble Tea (with the import name tea) 2020-05-25 19:48:36 -04:00
Christian Muehlhaeuser
cd4e02b1a8
Simplify code a bit 2020-05-25 14:12:30 +02:00
Christian Rocha
61285e4e90
Disable OnResize command on Windows 2020-05-18 11:44:58 -04:00
Christian Rocha
d2ae1b0fb7
Add command for listening for window resizes 2020-05-17 19:28:12 -04:00
Christian Rocha
db4600aeb2
Add a command and message for getting terminal size
There may be too much rigamarole around this (it's simpler to get the size
imperatively and synchronously) but adding it for now.
2020-05-14 10:49:08 -04:00