Commit graph

25 commits

Author SHA1 Message Date
Ayman Bagabas
608155cf09
refactor: remove WithInputTTY option and related code 2025-10-01 13:50:33 -04:00
Ayman Bagabas
33dd5b01ba
refactor: rework tracing and use a standalone logger 2025-05-19 13:23:45 -04:00
Andrey Nering
7858a14b45 ci: fix lint issues 2025-04-08 10:56:42 -03:00
Ayman Bagabas
0153aab95c
fix(lint): godox linter warning 2025-03-11 15:13:03 -04:00
Ayman Bagabas
61bc663925
fix(lint): godox comment should be at the beginning of the comment line 2025-03-11 15:08:56 -04:00
Ayman Bagabas
57e73739d6
fix(lint): handle lint warnings in tty_windows.go 2025-03-11 15:04:01 -04:00
Ayman Bagabas
cde486ce24 fix: windows: unused lint issue 2025-02-13 12:05:38 -05:00
Ayman Bagabas
ff9d66c749
fix(windows): we need to ensure that newline auto return is disabled 2024-10-16 16:53:00 -04:00
Ayman Bagabas
9636413107 fix: use safeWriter to guard writing to output
This implements a wrapper around p.output that locks the output on every
write. We also need to redefine `channelHandlers` to be thread-safe
since `p.Kill()` can be called from a different thread while the program
is running.
2024-09-12 13:22:33 -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
46241068da
feat: reduce console/term dependencies (#897)
Replace mattn/isatty and containerd/console with golang.org/x/term.

This mostly affects Windows. On Windows, unlike Unix, the console (TTY)
has different handles for input/output. Using the Console API, we need
to enable VT input on the input handle (CONIN) and VT processing on the
output handle (CONOUT). Doing so enables processing VT sequences on
Windows i.e. ANSI colors, mouse sequences, cursor movements, etc.

We already handle enabling VT processing for the program output using
Termenv `EnableVirtualTerminalProcessing`. For the input side, we enable
VT input right before setting the console to raw.

By doing this, we can drop both containerd/console and mattn/isatty.
2024-03-01 15:53:09 -05:00
Christian Muehlhaeuser
6c449e55bf feat: use Termenv.Output to write to tty 2022-09-27 02:49:36 +02:00
Christian Rocha
ab60d776f1 Add missing Go 1.17 build tags in Windows files 2021-10-02 21:13:03 -04:00
Christian Rocha
5f41a91e02 Fix Windows stuff related to the refactor at 49a5d16 2021-08-02 10:50:04 -04:00
Christian Rocha
e1ca585c16 Simplify how we enable ANSI colors on Windows 2021-08-02 10:50:04 -04:00
Christian Rocha
9f9b3aea96 Read input regardless of whether or not it's a TTY
This commit also contains some refactors:

* Refactor away inputStatus type
* Refactor away program.inputIsTTY member
* Simplify how we setup and restore input when it's a TTY
2021-08-02 10:50:04 -04:00
Christian Rocha
0780601791 Open a TTY if input is not a TTY, unless the user has spec'd otherwise 2021-02-27 16:03:34 -05:00
Christian Rocha
64da3bcf7a Use correct output when enabling ANSI colors on Windows (see #39) 2020-12-30 22:23:19 -05:00
Christian Rocha
4d14af713f
Remove pkg/term dependency 2020-10-13 12:55:38 -04:00
Christian Rocha
9c9a92c349
Add Windows support 2020-10-12 23:14:55 -04:00
Christian Rocha
3b8b011b5a
Rename to Bubble Tea (with the import name tea) 2020-05-25 19:48:36 -04:00
Christian Rocha
4bf40fbe62
Rename project to Boba 2020-05-12 16:39:08 -04:00
Christian Muehlhaeuser
f382f4db4a
Move ansi helpers to termenv 2020-01-31 13:52:20 +01:00
Christian Muehlhaeuser
bc67e3896b
Add platform-specific terminal init & restore 2020-01-25 07:15:29 +01:00