* feat: updating x/ansi
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* fix: enable/disable mode
* fix: execute in private mode, fix tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* fix: update deps
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* fix: test
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* feat: update cellbuf
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* all the updates
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* 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
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.
This adds support to the Windows Console Input Buffer API which access
the console API directly without the need for virtual terminal input
(i.e. the current mode that emulates unix inputs).
Since this uses the console input api, we can finally read window size
events.
This is mearly based on the awesome work of @erikgeiser in #140.
Fixes: https://github.com/charmbracelet/bubbletea/issues/538
Fixes: https://github.com/charmbracelet/bubbletea/issues/121