Commit graph

23 commits

Author SHA1 Message Date
Ahmet Kamer Çivi
1b8005fc10
fix: avoid terminal wait without input (#1829)
Co-authored-by: Drew Smirnoff <drew@charm.land>
2026-11-12 17:32:37 +04:00
赵鑫亿
9806b0c763
fix(exec): clear View before releasing terminal for subprocess (#1762)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Drew Smirnoff <drew@charm.land>
2026-11-12 17:23:45 +04:00
Liam Stanley
c60f0c5304
fix: prevent data race with cursedRenderer.onMouse (#1691)
- closes #1690
- adds `-race`, `-count`, and `-cpu`
- make all viable tests parallel

Signed-off-by: Liam Stanley <liam@liam.sh>
2026-05-11 21:11:40 -04:00
chaoliang yan
074596e14e
fix: skip input reader restore when input is disabled (#1680)
Co-authored-by: lawrence3699 <lawrence3699@users.noreply.github.com>
2026-04-20 09:45:06 -04:00
Ayman Bagabas
78e3b36c60
fix: remove resetLinesRendered calls around exec
Resetting the lines rendered around exec was causing issues with cursor
position after exec commands. For example, if you want to persist the
output of your program after an exec command that uses the altscreen,
this would break that functionality.

We really need to choose one behavior or the other here, and I think
removing these calls is the right choice.

Reference: https://github.com/charmbracelet/bubbletea/pull/1276
Reference: https://github.com/charmbracelet/bubbletea/issues/1275
2025-10-14 13:34:51 -04:00
Ayman Bagabas
be3c7e5427
refactor: restore options 2025-10-14 11:49:17 -04:00
Ayman Bagabas
cf6866fe56
fix: add View to Model interface and introduce DisableRenderer field 2025-10-01 13:50:43 -04:00
Ayman Bagabas
bd747e7bfa
refactor: clean up redundant code and update testdata 2025-10-01 13:50:38 -04:00
Ayman Bagabas
6b6414508e
refactor: replace WithInput and WithOutput options with Input and Output fields on Program struct 2025-10-01 13:50:33 -04:00
Ayman Bagabas
688573d200
refactor: remove WithContext and pass context to Run 2025-10-01 13:50:32 -04:00
Ayman Bagabas
911530d0a3
Merge branch 'main' into v2-exp 2025-07-07 16:42:38 -04:00
Raphaël Vigée
78ed49b060
fix: maintain exec output (#1276)
* Maintain exec output

* add test

---------

Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>
2025-05-13 12:27:50 -04:00
Ayman Bagabas
cb090c0aed
fix: lint: use isWindows() helper function 2025-05-01 11:53:10 -04:00
Ayman Bagabas
9087113343
feat,refactor!: introduce cursor model (#1303)
This introduces a new `CursorModel` interface that can be implemented by
the main model to provide a cursor position and style. A nil cursor will
hide the cursor. Otherwise, the cursor will be shown at the position and
with the style specified. Use `NewCursor` to quickly create a cursor for
a given position with default styles. This method is called in-sync with
the `Model.View` method.

It also removes the previously introduced `Frame` type and `NewFrame`
function. The main model can now return a `string` to render the program's
UI. The main model can return a `Cursor` to set the cursor position and
style.

The old `Init` method is now back and it returns a `Cmd` instead of a
both a `Model` and a `Cmd`. This is to make the mental model more straight
forward, and to keep things backwards compatible.
2025-02-04 12:47:23 -05:00
Ayman Bagabas
d93aa0090d
refactor!: model stringer interface 2025-01-23 14:58:43 -05:00
Ayman Bagabas
023af98640
feat: add Frame type and remove cursor commands
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.

Supersedes: https://github.com/charmbracelet/bubbletea/pull/1293
2025-01-23 14:57:54 -05:00
Ayman Bagabas
9f6f5cd193 chore: merge branch 'main' into v2-exp 2024-10-21 12:37:45 -04:00
Ayman Bagabas
cd1e4d34a7 fix: exec tests on windows
Windows doesn't have true/false binaries
2024-10-20 21:45:53 -07:00
Ayman Bagabas
c35932f7ba fix(windows): test cases on windows 2024-10-15 18:49:46 -07:00
Ayman Bagabas
ad68c4205f
feat!: make Init return the model (#1112) 2024-08-23 16:21:21 -04:00
Christian Muehlhaeuser
13cdfd2719 test: exec returning an error for invalid and failing commands 2022-10-09 03:46:59 +02: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
5c8eb85b69 test: exec binary from within tea.Program 2022-09-27 09:16:00 +02:00