739 Commits

Author SHA1 Message Date
Mitchell Hashimoto
c18527384e terminal: sgr parsing doesn't parse 4-form 48, allows unstyled underline
Fixes #362

We previously tried to parse 4-form 48, but as far as I can tell this is
never used anyways and in this real world scenario it expected us to
parse a 3-form followed by an underline. This fixes the real world
scenario as priority and adds a test.

This also fixes an issue where single form colon underline may actually
exist, again from a real world scenario.
2023-08-30 14:58:44 -07:00
Mitchell Hashimoto
fb2d4faa03 terminal: add contrast function based on w3c 2023-08-30 10:18:18 -07:00
Mitchell Hashimoto
0e8412ec19 terminal: add w3c luminance formula 2023-08-30 10:10:45 -07:00
Mitchell Hashimoto
3391908a82 terminal: get rid of duplicate RGB struct 2023-08-30 08:48:57 -07:00
Mitchell Hashimoto
7e846bd367 terminal: tabstops were off by one
Fixes #359

See #359 for a test script. The unit tests were also wrong. I used the
test script in #359 to verify the exact column that tabstops should be
set at.
2023-08-29 20:18:54 -07:00
Mitchell Hashimoto
ed5c001690 font/shaper: split ligature around cell style change 2023-08-29 14:09:21 -07:00
Mitchell Hashimoto
2cc1e43716 termio: handle all the synchronized output setting, timer 2023-08-28 11:35:40 -07:00
Mitchell Hashimoto
3b9d5d27ad terminal: implement DECRQM (request mode) 2023-08-28 08:50:11 -07:00
Mitchell Hashimoto
cbfa22555e terminal: test to ensure that DECRQM can parse 2023-08-28 08:36:00 -07:00
Mitchell Hashimoto
be27b825f3 terminal: resize with less cols preserves zero width codepoints 2023-08-28 08:18:03 -07:00
Mitchell Hashimoto
c243c9d72e terminal: screen test dumpString function should add graphemes 2023-08-28 08:07:40 -07:00
Mitchell Hashimoto
e6edf3105e font: grapheme clusters need to find a single font for all codepoints
When font shaping grapheme clusters, we erroneously used the font index
of a font that only matches the first codepoint in the cell. This led to the
combining characters being [usually] unknown and rendering as boxes.

For a grapheme, we must find a font face that has a glyph for _all codepoints_
in the grapheme.

This also fixes an issue where we now properly render the unicode replacement
character if we can't find a font satisfying a codepoint.
2023-08-26 09:35:56 -07:00
Mitchell Hashimoto
86495e826c Merge pull request #317 from mitchellh/kitty-gfx
Kitty Graphics Protocol Initial Support
2023-08-24 08:50:13 -07:00
Mitchell Hashimoto
708d6a4323 terminal/kitty-gfx: todo notes 2023-08-24 08:48:45 -07:00
Mitchell Hashimoto
f2f2b1eaf1 termio/exec: initial subprocess screen size should be sub padding 2023-08-24 08:45:32 -07:00
Mitchell Hashimoto
c962bd0abf terminal/kitty-gfx: add error if both image id and num is set 2023-08-24 08:33:58 -07:00
Mitchell Hashimoto
ec5dcf0850 terminal/kitty-gfx: do not send response on transmit/display unless I 2023-08-23 22:37:01 -07:00
Mitchell Hashimoto
35f1a9a478 terminal/kitty-gfx: transmission only sends response when no more chunks 2023-08-23 22:01:21 -07:00
Mitchell Hashimoto
bf7054eeb6 terminal/kitty-gfx: ignore extra base64 padding 2023-08-23 21:52:50 -07:00
Mitchell Hashimoto
21ce787cff terminal/kitty-gfx: data chunk can be zero size 2023-08-23 19:31:46 -07:00
Mitchell Hashimoto
53452bab78 terminal/kitty-gfx: chunked transmit and display 2023-08-23 17:55:41 -07:00
Mitchell Hashimoto
23c7d95ee1 terminal/kitty-gfx: only enable on Metal for now 2023-08-23 17:07:50 -07:00
Mitchell Hashimoto
46ba3189f6 config: image-storage-limit to set maximum image memory per terminal 2023-08-23 16:58:16 -07:00
Mitchell Hashimoto
79ea2ff2db terminal/kitty-gfx: update todo 2023-08-23 16:45:23 -07:00
Mitchell Hashimoto
83e396044b terminal/kitty-gfx: add per-screen storage limit 2023-08-23 14:14:31 -07:00
Mitchell Hashimoto
91a4be4ca1 terminal/kitty-gfx: add file loading safety checks from Kitty 2023-08-23 11:52:31 -07:00
Mitchell Hashimoto
135250018e terminal/kitty-gfx: get rid of selection 2023-08-23 11:41:49 -07:00
Mitchell Hashimoto
de3ef0f78c terminal/kitty-gfx: hook up delete 2023-08-23 11:37:14 -07:00
Mitchell Hashimoto
81498fe9be terminal/kitty-gfx: delete newest 2023-08-23 11:35:14 -07:00
Mitchell Hashimoto
c0b58802ba terminal/kitty-gfx: images store transmit time 2023-08-23 11:17:58 -07:00
Mitchell Hashimoto
73976824a1 terminal/kitty-gfx: delete by column, row, z 2023-08-23 11:12:51 -07:00
Mitchell Hashimoto
6f7a9c4523 terminal/kitty-gfx: we need to use rect, not sel 2023-08-23 11:07:48 -07:00
Mitchell Hashimoto
98f1b55ea4 terminal/kitty-gfx: delete intersection 2023-08-23 11:00:13 -07:00
Mitchell Hashimoto
9ab25ef350 terminal/kitty-gfx: delete intersecting cursor 2023-08-23 10:53:38 -07:00
Mitchell Hashimoto
6244cc38cc terminal/kitty-gfx: delete by id 2023-08-23 10:38:40 -07:00
Mitchell Hashimoto
4b38fb96db terminal/kitty-gfx: honor "z" setting 2023-08-23 09:55:13 -07:00
Mitchell Hashimoto
a082e4c1a2 terminal: delete lines (CSI M) should clamp count to remaining lines 2023-08-22 16:43:21 -07:00
Mitchell Hashimoto
33c21c7339 terminal: mark kitty images as dirty on resize 2023-08-22 14:46:23 -07:00
Mitchell Hashimoto
7ff76ca00d terminal/kitty-gfx: respect display c/r params 2023-08-22 14:43:50 -07:00
Mitchell Hashimoto
3bbfee676b terminal/kitty-gfx: process source rectangle display params 2023-08-22 14:33:41 -07:00
Mitchell Hashimoto
84c72bbe46 renderer/metal: honor cell offset graphics command 2023-08-22 13:28:40 -07:00
Mitchell Hashimoto
e6155b7f19 terminal/kitty-gfx: add placement function get selection 2023-08-22 13:15:00 -07:00
Mitchell Hashimoto
65df9f4618 terminal/kitty-gfx: down movement off by one 2023-08-22 12:23:27 -07:00
Mitchell Hashimoto
3c513ccbcf terminal/kitty-gfx: cursor pos x/y were flipped 2023-08-22 12:20:29 -07:00
Mitchell Hashimoto
71f1f35cfc terminal/kitty-gfx: move cursor after image placement 2023-08-22 12:15:51 -07:00
Mitchell Hashimoto
5a9bbcbc2d renderer/metal: clip image if necessary off top of viewport (scrolling) 2023-08-22 11:32:45 -07:00
Kevin Hovsäter
59fd918443 Allow optional OSC 52 parameter
Quoting from the XTerm documentation:

The first, Pc, may contain zero or more characters from the set c, p, q,
s, 0, 1, 2, 3, 4, 5, 6, and 7. It is used to construct a list of
selection parameters for clipboard, primary, secondary, select, or
cut-buffers 0 through 7 respectively, in the order given. If the
parameter is empty, xterm uses s 0 , to specify the configurable
primary/clipboard selection and cut-buffer 0.

See https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
2023-08-22 14:20:19 +02:00
Mitchell Hashimoto
da4ead8f60 renderer/metal: deallocate unused image textures 2023-08-21 22:11:58 -07:00
Mitchell Hashimoto
20257c7a87 renderer/metal: images required by placements become textures 2023-08-21 21:40:57 -07:00
Mitchell Hashimoto
11bf2680b7 terminal/kitty-gfx: make some args const 2023-08-21 16:07:41 -07:00