Commit graph

73 commits

Author SHA1 Message Date
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
Jora Troosh
4a463cfa3a
refactor: make code more idiomatic
- Added standard .gitattributes file for Zig projects.
- Reworked build.zig a little, hopefully it's a bit clearer. Also, now zig build will run all steps.
- outer: while in examples was redundant since there's only one loop to break from. switch expressions don't allow breaking from them, so breaking is only for loops, i.e. while and for.
- When returning a struct instance from a function, the compiler infers the return type from function signature, so instead of return MyType{...}; , it's more idiomatic to write return .{...};.
- Logging adds a new line by default, so you don't usually need to write \n like here: log.debug("event: {}\r\n", .{event});.
2024-02-11 12:59:33 -06:00
Tim Culverhouse
a733860a21 add pathological example as a terminal perf test 2024-02-09 12:27:22 -06:00
Tim Culverhouse
f3cf7bcfcd mouse: implement mouse parsing and events
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-31 12:50:00 -06:00
Tim Culverhouse
43f73eb895 image: implement deleting images from memory
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-31 07:18:16 -06:00
Tim Culverhouse
23a00ede55 images: kitty support works well
We still need to handle querying for support.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-30 20:51:54 -06:00
Tim Culverhouse
f901dde2a0 images: kitty image protocol works
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-30 16:26:35 -06:00
Tim Culverhouse
cc75fe6272 image: implement transmitting images
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-30 13:30:36 -06:00
Tim Culverhouse
9950c9eac5 vaxis: mode cleanup, initial mouse implementation
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-24 18:36:45 -06:00