Commit graph

59 commits

Author SHA1 Message Date
Ayman Bagabas
3fc1c224d4
chore: merge branch 'main' into v2-exp 2025-02-12 17:03:48 -05:00
Ayman Bagabas
47166e9a7a
chore: remove trailing newlines and update testdata
The new renderer now always moves the cursor to the beginning of
the next line on exit.
2025-02-10 17:02:33 -05:00
Ayman Bagabas
771a101562
fix: renderer: use newline instead of cud1 to move cursor down (#1323)
* fix: renderer: use newline instead of cud1 to move cursor down

Using cud1 (`\x1b[B`) won't scroll the terminal if the cursor is already
at the bottom of the screen. Instead, use a newline character to move
the cursor down and scroll the terminal if necessary.

Fixes: https://github.com/charmbracelet/bubbletea/issues/1322

* chore(examples): update tesdata
2025-02-10 16:21:20 -05:00
Christian Rocha
06e7f63413
docs(examples): update various examples per v2 changes 2025-02-04 16:17:44 -05:00
Ayman Bagabas
55f6f9f70b
chore(examples): update examples 2025-01-23 15:42:03 -05:00
Ayman Bagabas
26be4d4138
feat: tests: use golden files to test screen sequences 2025-01-13 08:20:20 +03:00
Ayman Bagabas
d4add5db79
chore: merge branch 'main' into v2-exp 2024-12-12 13:37:03 -05:00
Ayman Bagabas
857823478f chore: bump ansi to v0.6.0 2024-12-10 12:42:11 -05:00
Ayman Bagabas
b7a3c35132 feat: make the ferocious renderer opt-in
The ferocious renderer is now opt-in. This commit adds a new option
`WithFerociousRenderer` that enables the ferocious renderer.
2024-11-12 16:42:38 -05:00
Ayman Bagabas
0b77768403
fix(examples): skip simple interactive test 2024-11-12 12:22:13 -05:00
Ayman Bagabas
a2c8b388d9
chore: merge branch 'main' into v2-exp 2024-11-05 10:57:44 -05:00
Konstantin Antonov
3dfbcd9c9b feat(render): skipping lines from previous frame 2024-10-30 09:43:53 -04:00
Konstantin Antonov
e44d9c6af2 update golden output 2024-10-30 09:43:53 -04:00
Ayman Bagabas
8e990207da
fix: skip test that fails due to color profile 2024-10-28 16:24:19 -04:00
Ayman Bagabas
43b11c30b3 fix: make grapheme clustering opt-in
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.
2024-10-22 21:55:07 -04:00
Ayman Bagabas
e812e941e7
fix: examples: update examples to use tea.KeyPressMsg and tea.MouseClickMsg 2024-10-11 11:53:41 -04:00
Ayman Bagabas
1678d85ce2
feat: use bubbles/v2 and bubbletea/v2 in examples and tutorials 2024-09-18 14:21:14 -04:00
Ayman Bagabas
3650670bdb
fix: reset terminal colors on exit using osc 110/111/112 2024-09-16 14:20:18 -04:00
Ayman Bagabas
4fa1f0608c
fix: terminal colors tests 2024-09-12 14:58:24 -04:00
Ayman Bagabas
ee120d5542
chore: update examples to use v2-exp 2024-09-12 11:39:54 -04:00
Ayman Bagabas
b2e983a1f1
feat: add mode 2027 grapheme clustering stubs (#1105)
* feat: add mode 2027 grapheme clustering stubs

This adds the necessary stubs to make mode 2027 (grapheme clustering)
work on Bubble Tea with renderers that support it.

* fix: screen grapheme clustering tests
2024-08-23 15:17:24 -04:00
Ayman Bagabas
356c649672
fix(examples): update testdata 2024-08-21 16:03:55 -04:00
Ayman Bagabas
4497aa9eef
fix: reset cursor position on renderer exit (#1058)
We need to reset the cursor position to the beginning of the line when
the program stops or exit.

Related: https://github.com/charmbracelet/gum/issues/607
2024-07-16 12:54:58 -04:00
Carlos Alexandro Becker
ea13ffb9a1
feat: allow to suspend bubbletea programs (#1054)
* feat: allow to suspend bubbletea programs

closes #497
closes #1053

* fix: typo

* fix: move things around, add example

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

* fix: block until CONT

* fix: ResumeMsg

* docs: improve example

* docs: one more example

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

* fix: examples tests

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

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-07-11 18:05:16 -03:00
Ayman Bagabas
cb801d8f2c
refactor: use x/term and x/ansi for renderer sequences (#962)
* refactor: use x/exp/term for renderer sequences

This replaces termenv.Output with raw sequences and a bytes.Buffer to
handle vt screen and cursor events.

* chore: update dependencies

* refactor: use x/term
2024-05-21 14:46:11 -04:00
Ayman Bagabas
8028edee96 fix: update examples testdata 2024-05-08 16:07:42 -04:00
Ayman Bagabas
a6f77ff8cd
chore(examples): use lipgloss everywhere possible (#963)
Lip Gloss abstracts away the color profiles logic and results in less
lines
2024-03-22 13:55:19 -04:00
Raphael 'kena' Poss
2b46020ca0
feat: bracketed paste (#397)
* feat: bracketed paste

This introduces support for input via bracketed paste, where escape
characters in the pasted input are not interpreted.

Pasted input are marked as a special field in the KeyMsg. This is
useful because pasted input may need sanitation in individual widgets.

* fix(key): support bracketed paste with short reads

Some terminal emulators feed the bracketed paste data in multiple
chunks, which may not be aligned on a 256 byte boundary. So it's
possible for `input.Read` to return less than 256 bytes read
but while there's still more data to be read to complete a bracketed
paste input.

---------

Co-authored-by: Christian Muehlhaeuser <muesli@gmail.com>
2024-02-05 14:49:09 +01:00
Ayman Bagabas
a154847611
feat: extended Coordinates mouse reporting & additional buttons support (#594)
* feat(mouse): add extended mouse & shift key support

Support SGR(1006) mouse mode
Support parsing shift key press
Support additional mouse buttons
Report which button was released
Report button motion

* fix: key.go sgr len missing calculation (#841)

* chore(test): add sgr mouse msg detect test

---------

Co-authored-by: robinsamuel <96998379+robin-samuel@users.noreply.github.com>
2023-12-04 11:50:59 -05:00
Carlos Alexandro Becker
b2d2ac6504
chore: update example tests, test on ci (#735)
* chore: update example tests, test on ci

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

* fix: mark *.golden as binary

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

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-06-09 09:17:15 -03:00
Carlos Alexandro Becker
25022e9789
example: using the x/exp/teatest package (#352)
teatest was originally designed in this PR, and was later moved into `github.com/charmbracelet/x`.

* docs: example test

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

* feat: teatest

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

* fix: improve api

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

* fix: improve api

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

* feat: goldenfiles

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

* chore: minor improvements

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

* feat: type text, diff

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

* fix: release terminal

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

* fix: lint

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

* fix: update cancelreader

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

* fix: make it safe

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

* feat: functional options

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

* feat: IsQuit and IsQuitMsg

* fix: save file

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

* fix: do not use deprecate func

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

* fix: make diff not complain about trailing whitespaces

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

* feat: with term size

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

* feat: RequireRegexOutput

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

* fix: update

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

* chore: rename

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

* fix: improve reliability

* fix: use returned model

* fix: making it more predictable, avoid sleeps

* fix: remove WithRequiredRegexpOutput

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

* fix: allow to assert within interactions

* feat: added wait for

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

* fix: optional

* feat: improve usage

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

* fix: use udiff

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

* feat: tea.Wait

wait for the underlying context to finish.

extract from #352

* fix: merge

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

* fix: wait til the end of shutdown

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

* fix: final output

* feat: use x/exp/teatest

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

* chore: go mod tidy

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

---------

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-05-05 16:14:26 -03:00
Glenn Gonda
4880cf2a09 docs: fix typos and clean up comments 2023-02-19 08:45:22 -05:00
Christian Muehlhaeuser
6b77c8fc10 chore: rename StartReturningModel to Run
Added aliases for the old functions, but deprecated them.
2022-10-08 01:34:17 +02:00
Christian Muehlhaeuser
22d15efad7 chore: clean up linter errors in examples 2022-10-08 00:56:56 +02:00
Maas Lalani
d20732aaea docs: add examples/gifs locally to repository 2022-10-03 15:07:28 -04:00
Maas Lalani
70576bc9e0
examples/README.md GIFs (#470)
* docs(examples): Add `examples/README.md`

Adds `examples/README.md` with GIFs of examples

* docs(examples): Individual READMEs

* docs(examples): add short description to each example
2022-10-03 12:06:18 -04:00
Ilya Revenko
29b7de4b7c
Fix more typos in examples (#102) 2021-05-28 19:45:17 +02:00
Christian Rocha
7c0bbc7d32 Clean up and normalize examples 2021-05-01 09:33:13 -04:00
Christian Muehlhaeuser
b6c7f93d9a Fix various typos in examples 2021-03-12 02:16:41 +01:00
Christian Rocha
141fc86ad0
Update wording in simple example 2020-10-15 20:51:28 -04:00
Christian Rocha
847787e46d
Convert remaining examples to Model interface-based structure 2020-10-15 19:48:42 -04:00
Christian Rocha
816428c135
Add comment for Init() in simple example 2020-10-15 16:19:13 -04:00
Christian Rocha
7af3e0e9de
Update simple example to use new Model interface-based structure 2020-10-15 16:08:42 -04:00
Christian Rocha
217c506a49
Add logging option in simple example 2020-06-16 22:32:06 -04:00
Christian Rocha
e79ee747c9
Fix import in simple example 2020-05-27 14:47:31 -04:00
Christian Rocha
40332a36b3
Migrate components over to github.com/charmbracelet/bubbles 2020-05-25 20:10:15 -04:00
Christian Rocha
3b8b011b5a
Rename to Bubble Tea (with the import name tea) 2020-05-25 19:48:36 -04:00
Christian Rocha
ade8203c21
Remove entire subscription model
It was a valiant effort, and the implementation was solid and
dependable, but at the end of the day we can achieve the same
functionality in a much simpler fashion with commands, especially
because Go is not held to the same restrictions as Elm.
2020-05-12 18:00:50 -04:00
Christian Rocha
82ddbb8e12
Move components over and update examples 2020-05-12 17:06:00 -04:00
Christian Rocha
4bf40fbe62
Rename project to Boba 2020-05-12 16:39:08 -04:00