Commit graph

19 commits

Author SHA1 Message Date
draw me an elephant
8b10e22689
fix: skip capability queries when input is disabled (#1801)
Co-authored-by: drew <me@andrinoff.com>
Signed-off-by: drew <me@andrinoff.com>
2026-09-24 12:05:48 +04:00
Ayman Bagabas
b947ade70d
refactor: change several message types to structs for extensibility 2025-11-04 14:01:26 -05:00
Ayman Bagabas
edc51e3dad
refactor: rename TerminalVersion to RequestTerminalVersion 2025-10-01 13:50:38 -04:00
Ayman Bagabas
2df9ed00e3 refactor: use x/input for input events
This moves the existing input event handling to the x/input package. All
input events are translated to tea messages in
`tea.translateInputEvent`.
2024-12-12 10:51:58 -05:00
Ayman Bagabas
7fbf91fb50 chore: update ansi and dependencies 2024-11-21 14:12:16 -05: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
4e118e9b7e
fix: lint issues 2024-09-12 12:06:11 -04:00
Ayman Bagabas
033071be4d
feat: export kitty/xterm/win32 input commands and messages 2024-08-30 09:37:22 -04:00
Ayman Bagabas
16f706ac13
refactor: expose key codes and define key/mouse interfaces 2024-08-30 09:37:07 -04:00
Ayman Bagabas
7b87642c87
refactor!: use key/mouse msg interfaces
Use key and mouse interfaces to catch their respective types as an
interface.
2024-08-30 09:37:07 -04:00
Ayman Bagabas
fa69e03c9e
fix: lint issues (#1109) 2024-08-22 12:56:15 -04:00
Ayman Bagabas
5f7700e132
refactor: unexport modify other keys 2024-08-20 12:06:49 -04:00
Ayman Bagabas
ad68fc1a72
feat: query modify other keys 2024-08-20 12:04:27 -04:00
Ayman Bagabas
c657bba74b
feat: query the terminal version string and primary device attrs (#1088)
This adds support for XTVERSION and DA1 querying.

XTVERSION responds with the version of the terminal (not supported by
all terminals)

DA1 responds with some of the terminal capabilities
2024-08-19 11:52:09 -04:00
Ayman Bagabas
26bc2cb52e
feat: query the terminal version string and primary device attrs
This adds support for XTVERSION and DA1 querying.

XTVERSION responds with the version of the terminal (not supported by
all terminals)

DA1 responds with some of the terminal capabilities
2024-08-15 18:39:31 -04:00
Ayman Bagabas
4d2072bfec
fix: kitty: request protocol flags and rename flag methods 2024-08-15 14:45:15 -04:00
Ayman Bagabas
eb2eee4d98
refactor: rename KeySym to KeyType and make KeyRunes the default 2024-08-15 13:55:32 -04:00
Ayman Bagabas
cb37f8847e
fix: rename events to messages 2024-08-13 11:02:10 -04:00
Ayman Bagabas
13ffcad06c
refactor: reimplement the event loop with a sequence parser
Currently, Bubble Tea uses a simple lookup table to detect input events.
Here, we're introducing an actual input sequence parser instead of
simply using a lookup table. This will allow Bubble Tea programs to read
all sorts of input events such Kitty keyboard, background color, mode
report, and all sorts of ANSI sequence input events.

Supersedes: https://github.com/charmbracelet/bubbletea/pull/1079
Supersedes: https://github.com/charmbracelet/bubbletea/issues/1014
Related: https://github.com/charmbracelet/bubbletea/issues/869
Related: https://github.com/charmbracelet/bubbletea/issues/163
Related: https://github.com/charmbracelet/bubbletea/issues/918
Related: https://github.com/charmbracelet/bubbletea/issues/850
Related: https://github.com/charmbracelet/bubbletea/issues/207
2024-08-12 17:33:51 -04:00