Tim Culverhouse
2f2e38eea5
widgets(terminal): set global_vts to null on last exit
2024-06-10 14:18:32 -05:00
Tim Culverhouse
044b099227
widgets(terminal): handle scrolling_region in CUU, CUD
2024-06-10 14:18:32 -05:00
Tim Culverhouse
11ae2e7b29
widgets(terminal): prevent deadlock in draw
...
The draw method could obtain a lock but never free it due to the logic
of the if statement.
2024-06-10 14:18:32 -05:00
Tim Culverhouse
3a382eacdb
widgets(terminal): fix overflow in CUP
2024-06-10 14:18:32 -05:00
Tim Culverhouse
aa9e492b26
widgets(terminal): simplify cursorLeft logic
2024-06-10 14:18:32 -05:00
Tim Culverhouse
cc77c98d32
widgets(terminal): implement CSI D
2024-06-10 14:18:32 -05:00
Tim Culverhouse
d991755fe2
widgets(terminal): handle exiting events
2024-06-10 14:18:32 -05:00
Tim Culverhouse
ef62de5541
widgets(terminal): dirty handling, cursor up, cursor shapes
2024-06-10 14:18:32 -05:00
Tim Culverhouse
c52bb30cdc
widgets(terminal): remove comment about default
2024-06-10 14:18:32 -05:00
Tim Culverhouse
3765dbef2b
widgets(terminal): handle (some) wrapping
2024-06-10 14:18:32 -05:00
Tim Culverhouse
7a7f4892d7
widgets(terminal): simple key encoding, alt screen
2024-06-10 14:18:32 -05:00
Tim Culverhouse
78508b76bd
widgets(terminal): improve logging
2024-06-10 14:18:32 -05:00
Tim Culverhouse
d36be9048c
widgets(terminal): allow for always joining thread
...
Write an EOT into the tty stream so after killing the process we
*always* are able to join the thread. Maybe this is the very reason the
EOT control byte exists?
2024-06-10 14:18:32 -05:00
Tim Culverhouse
f9d2fc7532
widgets(terminal): append last byte to escape seqs
2024-06-10 14:18:32 -05:00
Tim Culverhouse
987f939bd8
widgets(terminal): support cursor mode
2024-06-10 14:18:32 -05:00
Tim Culverhouse
36854123fe
widgets(terminal): use types for c0 and csi
2024-06-10 14:18:32 -05:00
Tim Culverhouse
ecb2ea20e4
widgets(terminal): more c0 control impls
2024-06-10 14:18:32 -05:00
Tim Culverhouse
3ff47e6845
widgets(terminal): remove comment
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
f76b573a0b
parser: fix remaining decrpm test
...
This test was passing because it's not meant to find the event. However
it was still using the wrong input
2024-06-10 14:17:48 -05:00
Tim Culverhouse
9c5e8898cd
parser: fix parsing of DECRPM and tests
...
We were looking for the wrong sequence
2024-06-10 14:00:51 -05:00
CJ van den Berg
a69cf3273d
build: export some symbols for thespian.Loop
2024-06-10 04:43:43 -07:00
Rylee Lyman
e2c19c3c8f
fix: update to zig 0.13, broken test
2024-06-09 04:53:58 -07:00
Jari Vetoniemi
9bbcebb7bc
ScrollView: do scroll bounds checking early
...
The ScrollView will panic if scroll.y is given a number that is outside
the content size.
2024-06-08 19:45:22 -07:00
Tim Culverhouse
0cb81e30eb
parser: fix handling of function keys with kitty encoding
2024-06-05 12:52:49 -05:00
Tim Culverhouse
91152eecdf
parser: remove log line
2024-06-05 11:56:08 -05:00
Tim Culverhouse
43a714de0c
parser: fix query responses for kitty kbd, decrpm
2024-06-05 11:49:03 -05:00
CJ van den Berg
d21940bdbd
build: make most dependencies optional
2024-06-05 07:31:46 -07:00
Tim Culverhouse
e8670bd585
tty(windows): refactor and complete windows tty
...
Refactor the tty implementations. Complete the windows implementation
2024-06-05 06:31:18 -07:00
Jari Vetoniemi
54def846bf
TextView: add Error to buffer operations
...
Typed error sets are nice to have.
2024-06-04 12:07:25 -07:00
Jari Vetoniemi
71b8ecc7c2
TextView: fix cols when appending to a buffer
...
If appending to a buffer through writer for example, the cols may not be
correct if the writes don't end up in a newline (\n). Fix this by
keeping track of the cols of previous append.
2024-06-04 12:07:25 -07:00
Tim Culverhouse
84cd9fdebe
fix(loop): fix stopping and starting of loop
...
When stopping the loop, we never reset `should_quit` which caused the
program to not read any input if the loop were started again
2024-06-03 07:36:12 -05:00
Tim Culverhouse
052ff24c2f
mouse: enable button motion tracking and any motion
...
Zellij doesn't support any motion at time of this commit, so we also try
to enable button motion first
2024-06-03 06:19:02 -05:00
Tim Culverhouse
3ea76daf28
vaxis: remove fixme
2024-06-02 17:58:32 -05:00
Tim Culverhouse
3ff1d0749a
vaxis: use legacy sgrs for VHS_RECORD
2024-06-02 17:49:08 -05:00
Tim Culverhouse
6b6807d9ec
resize: reset cursor sgr prior to erasing screen
...
Reset cursor sgr to prevent erasing the screen with some unknown
background color.
2024-06-01 06:52:21 -05:00
Jari Vetoniemi
ee113c4269
widgets: add CodeView widget
...
CodeView widget allows viewing code in a more visually pleasing manner.
It combines LineNumbers widget to provide line numbers on the side.
The CodeView widget allows you to optionally highlight a specific line
and show indentation guidelines.
It is not intended to be a fully fledged editor, but rather for showing
code snippets to a user.
While it is not a fully fledged editor, this widget's code can give you
a good starting point.
2024-05-31 18:21:54 -05:00
Jari Vetoniemi
84b4821d43
widgets: add TextView widget
...
The TextView widget provides a simple way to show text content in
a scrollable window.
This implementation does not offer automatic line wrapping for now.
Text content is backed by the Buffer struct. The buffer can be styled
for visually appealing and colorful content, for example to provide
a syntax highlighting.
The buffer provides a writer() interface which allows providing content
from a stream, such as logging.
2024-05-31 18:21:54 -05:00
Jari Vetoniemi
b215aec75b
widgets: add LineNumbers widget
...
The LineNumbers widget draws vertical list of numbers.
This can be used as a line number bar for a text editor for example.
2024-05-31 18:21:54 -05:00
Jari Vetoniemi
f25b8ab421
widgets: add ScrollView widget
...
The ScrollView widget can be used to introduce scrollable elements into
existing widgets.
To use the ScrollView, you must use the ScrollView's writeCell and
readCell functions rather than the ones from Window.
2024-05-31 18:21:54 -05:00
Rylee Lyman
fbaa6ca8df
fix: manually reschedule to avoid hang on macOS
...
libxev's .rearm semantics are unfortunately not very
portable---rescheduling the exact same event on macOS / kqueue seems
to cause the event loop to hang, while manually rescheduling and
returning .disarm does not.
2024-05-31 11:17:08 -05:00
Tim Culverhouse
49cc8ae7c4
xev: change log scope
...
We don't want the scope to look like it's from the xev library
2024-05-30 16:03:59 -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
04f1586e8f
vaxis: add panic handler function
...
Applications may use this to handle panics gracefully
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
cf2d2ab50b
GraphemeCache: remove testing alias
2024-05-29 10:27:59 -05:00
Tim Culverhouse
572bb8ba6a
image: remove testing alias
2024-05-29 10:26:28 -05:00