Commit graph

10 commits

Author SHA1 Message Date
yingshanghuangqiao
b6958d3adc chore: fix some comments
Signed-off-by: yingshanghuangqiao <yingshanghuangqiao@foxmail.com>
2025-07-22 13:11:26 -04:00
Josh Allen
0a63003a85
fix: Windows: first character input lost on successive programs (#1368)
* Fix: Windows: first character input lost on successive programs

* lint G115

* intToUint32OrDie

* avoid max check

math.MaxUint32 (untyped int constant 4294967295) overflows int
2025-07-07 15:59:42 -04:00
Ayman Bagabas
bf1216dfaf
fix: windows: enable mouse mode on demand (#1340)
Since we added native Windows API input events support, we always enable
mouse events even if the user doesn't want them. This is a problem because
it breaks applications that don't expect mouse events and selection
stops working without any modifier key.

Fixes: https://github.com/charmbracelet/bubbletea/issues/1313
2025-02-25 11:52:37 -05:00
Ayman Bagabas
b0186ada89
fix: windows: handle cancel io error
This gracefully handles windows.CancelIo errors.

Fixes: c8d6005325 (fix: use CancelIoEx to cancel Windows conInputReader across threads (#1305))
Fixes: https://github.com/charmbracelet/bubbletea/issues/1324
2025-02-10 16:30:09 -05:00
Adam Woodbeck
c8d6005325
fix: use CancelIoEx to cancel Windows conInputReader across threads (#1305)
The Windows conInputReader uses `windows.CancelIo` to close the read
loop's input handle. Windows `CancelIo` docs indicate that call is only
appropriate for I/O operations on the same thread as the `CancelIo`
call. Since the read loop is in its own goroutine, it's likely to be on
another thread from the bubbletea Program.

This change adds a call to Windows `CancelIoEx`, which will cancel I/O
operations across threads.

Fixes #1167
2025-02-04 11:09:49 -05: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
920d07b07c fix(windows): clean up windows input reader
Remove unused and use CancelIo API to cancel reads.
2024-05-17 11:29:19 -04:00
kaifulee
db4cd9e912 chore: fix typo
Signed-off-by: kaifulee <cuishuang@outlook.com>
2024-03-15 11:15:21 +01:00
Ayman Bagabas
73d971c9b0
fix(windows): don't process ctrl+c
Ctrl+c is handled by the Tea program rather than the Console API

Fixes: 75966e8578 (feat: support windows console input buffer (#878))
2024-03-02 16:22:46 -05:00
Ayman Bagabas
75966e8578
feat: support windows console input buffer (#878)
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
2024-02-27 14:21:42 -05:00