Commit graph

81 commits

Author SHA1 Message Date
ippsav
09a4de63e5 fix: missing tty.deinit calls 2024-07-05 04:52:33 -07:00
Jari Vetoniemi
9b78bb8a78 aio: update to latest, windows, code reuse
Update to latest aio, which has minor changes such as the thread pool
argument and special aio.ReadTty operation.

In future the aio.ReadTty might have option to translate to vt escape
sequences, but for vaxis it will use the direct mode.

I was not really able to test the windows at all actually as wine did
not seem to play nice with any vaxis example, but it compiles and ...
runs?
2024-06-30 08:44:04 -07:00
Jari Vetoniemi
b84f9e58a6 vaxis: add aio event loop and example
disabled by default, aio/coro might not be that mature yet.
however, appreciated if people give it a go and report issues.
2024-06-27 08:32:21 -07:00
Tim Culverhouse
0c91840b32 widgets(terminal): implement OSC 7 for pwd reporting 2024-06-19 09:23:11 -05:00
Tim Culverhouse
7005bb237c widgets(terminal): add initial_working_directory option 2024-06-19 07:11:02 -05:00
Tim Culverhouse
6043f0569a widgets(terminal): remove error logs
And use a buffered writer in the example
2024-06-18 18:41:48 -05:00
Rylee Lyman
f25a9b9660 fix: deinit TTY to avoid stair-stepped output 2024-06-13 12:34:03 -07:00
Rylee Lyman
f57ba4b477 fix: add ThreadPool for key events on macOS 2024-06-13 07:40:24 -07:00
Tim Culverhouse
f230f0c30a widgets(terminal): send a redraw event 2024-06-12 19:29:19 -05:00
Tim Culverhouse
46e7fd8fc6 widgets: remove neovim widget
The neovim widget was great. But we have a full virtual terminal widget
now, which doesn't bring in extra dependencies.
2024-06-11 20:35:10 -05:00
Tim Culverhouse
9c723bb645 examples(vt): use shell environment for command 2024-06-11 19:09:55 -05:00
Tim Culverhouse
6d4c180e31 widgets(terminal): implement legacy key encoding 2024-06-11 14:00:37 -05:00
Tim Culverhouse
9f2af4d5ee widgets(terminal): implement even more csi sequences 2024-06-10 14:18:55 -05:00
Tim Culverhouse
21f2a48a80 examples: update terminal example 2024-06-10 14:18:32 -05:00
Tim Culverhouse
f21559cc51 widgets(terminal): begin terminal widget 2024-06-10 14:18:32 -05:00
Tim Culverhouse
3c29f18251 examples(text_input): use all kitty flags 2024-06-05 12:37:27 -05:00
Tim Culverhouse
ef028bfe72 examples: remove pause_tui 2024-06-03 08:19:40 -05:00
Tim Culverhouse
7014a38a9c readme: add gif 2024-06-02 07:19:28 -05:00
Tim Culverhouse
00afc7c130 examples(xev): don't render in the eventCallback 2024-05-30 12:05:18 -05:00
Tim Culverhouse
d294428b74 examples(xev): duplicate functionality of vaxis example
The xev example is now a complete replication of the vaxis example, but
using xev as the event loop
2024-05-30 11:10:03 -05:00
Tim Culverhouse
335ea9f2d0 xev: fix todos 2024-05-30 10:06:28 -05:00
Tim Culverhouse
bbd9184e00 loop: add an xev loop implementation
This loop adds an xev.File wrapper called TtyWatcher which delivers
events to the users callback. Note that this implementation does not
handle any of the writes. Writes are always safe in the main thread, so
we let users decide how they will schedule those (buffered writers, xev
writes, etc)
2024-05-30 09:43:48 -05:00
Tim Culverhouse
5f41978054 refactor(vaxis): require an io.AnyWriter for writes
All vaxis functions that write to the terminal now require an
io.AnyWriter as a parameter
2024-05-29 13:13:54 -05:00
Tim Culverhouse
59abd7d7d4 refactor(vaxis): move tty out of vaxis
Refactor to move the tty out of the vaxis struct. All vaxis writes now
take an io.AnyWriter
2024-05-29 11:33:39 -05:00
Tim Culverhouse
0fa082033e examples: add readline example 2024-05-24 11:00:35 -05:00
Tim Culverhouse
409e17b883 examples: add vaxis example 2024-05-24 08:04:54 -05:00
CJ van den Berg
55809160b9 vaxis: detect pixel mouse mode and translate coordinates to cell offsets
This detects support for pixel mouse mode so it can be enabled only
if supported.

This also translates pixel coordinates to something more compatible
with plaine cell coordinates. This make it much easier to write
applications that support both.
2024-05-22 15:04:26 -05:00
Tim Culverhouse
1b957ec84e fix examples, update readme features 2024-05-22 14:09:15 -05:00
CJ van den Berg
d48826c0b1 vaxis: add osc52 copy/paste support 2024-05-22 13:51:19 -05:00
Tim Culverhouse
a1263b1baa mouse: enable pixel tracking 2024-05-21 15:00:14 -05:00
Tim Culverhouse
1dc90bd764 image: use image options struct, add more functionality
Use an options struct for controlling image output. Add more
functionality from the core kitty image protocol
2024-05-21 11:14:07 -05:00
00JCIV00
d75c44725e Added the basic example for pausing the TUI with a Child Process. 2024-05-12 20:25:51 -05:00
00JCIV00
a07d4f19a7 Reorganized Namespaces
- Consolidated `main.zig` into `vaxis.zig` as the new library entry point.
- Exposed more Types throughout the library for more transparent doc navigation.
- Reorganized certain Modules and Types to be more coherent and readable.
- Re-generated docs to reflect these changes.
2024-05-12 20:25:51 -05:00
00JCIV00
f8544be262 Added the table.zig example
- Created a basic user management example for the Table widget.
2024-05-12 20:25:51 -05:00
Tim Culverhouse
bb5d79ef75 core: implement legacy SGR sequences and fallbacks 2024-05-08 13:59:57 -05:00
Tim Culverhouse
6abfd8fc3f render: skip clearing images if they aren't supported 2024-05-03 13:57:03 -05:00
Tim Culverhouse
ed1867cf39 examples(nvim): update example api
The nvim widget needs work, but at least you can run the example
2024-05-02 20:13:45 -05:00
Tim Culverhouse
a0db41f87c render: add cli renderer
Add a renderer for applications running on the primary screen. This
renderer uses relative cursor positioning, and works with all the same
primitives as the alternate screen.

Fix a bug where repositioning was never turned back to false. This was a
nasty one with huge perf implications.

Set internal cells to a space and default on init. This prevents us from
writing them. As a result, we now issue a hardware clear on resize.
2024-05-02 12:50:33 -05:00
Tim Culverhouse
50242b984b loop: fully clean up tty when stopping event loop
Previously, stopping the read thread would not fully clean up the tty.
This could result in issues such as #9 where the terminal state was
borked upon return to shell or if temporarily exiting the TUI.

Fixes: #9
2024-04-30 16:42:10 -05:00
Tim Culverhouse
2d48093d3a examples(pathological): improve printing of time 2024-04-30 12:57:29 -05:00
Tim Culverhouse
5ad01f6a3a image: fix base64 and example 2024-04-30 09:02:16 -05:00
forgoty
019669d2f0 Fix examples: main, pathological, table. 2024-04-29 17:51:33 -05:00
Tim Culverhouse
9fec6f122b core: replace ziglyph.GraphemeIterator with zg version
ziglyph is being replaced by zg. Replace all calls to ziglyph grapheme
iterator with the zg version
2024-04-29 13:03:01 -05:00
Tim Culverhouse
e7915b5dd7 examples: fix api for main, pathological, table 2024-04-29 12:35:02 -05:00
Tim Culverhouse
41f76e8f03 vaxis: refactor to split Loop and Vaxis
Refactor the main API to split Loop and Vaxis types. This enables the
core Vaxis type to be more easily referenced in other types, since it
doesn't require a comptime type parameter. This will make the switch to
the zg unicode library easier.
2024-04-29 12:26:50 -05:00
Tim Culverhouse
606272f471 widgets: add initial nvim implementation 2024-04-16 16:06:14 -08:00
Tim Culverhouse
117545ca4b window: add custom border location option
Add a way to draw borders in custom locations
2024-03-26 15:11:20 -05:00
Tim Culverhouse
d40fb7cbdb examples: clear textinput on enter 2024-03-19 13:24:17 -05:00
00JCIV00
e87d64a2b3 Added the table.zig example
- Created a basic user management example for the Table widget.
2024-02-26 19:27:56 -06:00
00JCIV00
b7d7ba6b36 example: s/start/startReadThread s/stop/stopReadThread 2024-02-26 19:06:05 -06:00