<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/dcs.c, branch 1.23.1</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.23.1</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.23.1'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2025-02-21T07:03:41Z</updated>
<entry>
<title>DECSCUSR+DECRQSS: treat hollow cursor as a block cursor</title>
<updated>2025-02-21T07:03:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-21T07:03:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4f11d6086fd9341e663fafaf2b256981af389eef'/>
<id>urn:sha1:4f11d6086fd9341e663fafaf2b256981af389eef</id>
<content type='text'>
If the user has configured cursor.style=hollow, make DECSCUSR 1/2 set
the cursor to hollow rather than block, and make DECRQSS DECSCUSR
respond as if cursor.style=block.

The idea is to not expose the hollow variant in DECSCUSR in any way,
to avoid having to extend it with custom encodings.

Another way to think about it is this is just a slightly more
discoverable way of doing:

    cursor.style=block
    cursor.block-cursor-is-hollow=yes
</content>
</entry>
<entry>
<title>config: add color.sixelN options</title>
<updated>2024-10-23T06:35:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-10-23T06:35:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=511aad419b9c869972902fe88b4f593b0faa6719'/>
<id>urn:sha1:511aad419b9c869972902fe88b4f593b0faa6719</id>
<content type='text'>
These options allows you to configure the default sixel color palette.
</content>
</entry>
<entry>
<title>xsnprintf: various improvements related to xvsnprintf() and xsnprintf()</title>
<updated>2024-09-13T07:01:15Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2024-09-11T19:13:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d4a1283797b5a964d92e64c698d65f701a90e1cc'/>
<id>urn:sha1:d4a1283797b5a964d92e64c698d65f701a90e1cc</id>
<content type='text'>
Summary of changes:

* Make xvsnprintf() static
* restrict-qualify pointer arguments (as done by the libc equivalents)
* Make comments and spec references more thorough
* Remove pointless `n &lt;= INT_MAX` assertion (see comment)
* Use FATAL_ERROR() instead of xassert() (since the assertion is inside
  a shared util function but the caller is responsible for ensuring the
  condition holds true)
* Change some callers to use size_t instead of int for the return value
  (negative returns are impossible and all subsequent uses are size_t)

The updated comments and code were taken (and adapted) from:

https://gitlab.com/craigbarnes/dte/-/blob/49260bb154bca0434462a41c061e512540ec2e49/src/util/xsnprintf.c#L6-50

This work was entirely authored by me and I hereby license this
contribution under the MIT license (stated explicitly, so that
there's no ambiguity w.r.t. the original license).
</content>
</entry>
<entry>
<title>Rename various uses of "curly" in the source code with "underline"</title>
<updated>2024-07-01T19:00:16Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2024-07-01T19:00:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=674a535fc3e1260762aaecb37af4a32581d9b0c6'/>
<id>urn:sha1:674a535fc3e1260762aaecb37af4a32581d9b0c6</id>
<content type='text'>
Since "curly" could make it seem as if all underline styles are curled
(to people unfamiliar with the codebase), whereas in reality only 1 is.
</content>
</entry>
<entry>
<title>dcs: DECRQSS: styled+colored underlines</title>
<updated>2024-07-01T14:25:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-01T14:25:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=64e7f2512481d33fb46b1cd3eff4b4854d634a2c'/>
<id>urn:sha1:64e7f2512481d33fb46b1cd3eff4b4854d634a2c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>dcs: XTGETTCAP: handle empty request</title>
<updated>2024-04-20T06:27:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-04-20T06:19:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4d4ef5eed536c373f93c766f4071e14665a9b00e'/>
<id>urn:sha1:4d4ef5eed536c373f93c766f4071e14665a9b00e</id>
<content type='text'>
If the XTGETTCAP request is empty (no capabilities in it), reply with
an empty error reply.

Closes #1694
</content>
</entry>
<entry>
<title>dcs: DECRQSS: fix off-by-one when checking for space in the DCS buffer</title>
<updated>2024-04-10T03:44:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-04-10T03:44:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9287946b3672d21fabd70ba4aeebc5a63e6259f9'/>
<id>urn:sha1:9287946b3672d21fabd70ba4aeebc5a63e6259f9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Don't use fancy Unicode quotes, stick to ASCII</title>
<updated>2024-02-06T11:36:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-02-06T11:36:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7999975016a57cc0a2c2e20bc55f29de32df7044'/>
<id>urn:sha1:7999975016a57cc0a2c2e20bc55f29de32df7044</id>
<content type='text'>
</content>
</entry>
<entry>
<title>dcs: xtgettcap: ignore queries with invalid hex encodings</title>
<updated>2023-09-25T14:37:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-09-25T14:37:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8a5f2915e9d327d1517d1da49ce7e2303fe61d36'/>
<id>urn:sha1:8a5f2915e9d327d1517d1da49ce7e2303fe61d36</id>
<content type='text'>
When we receive an XTGETTCAP query, where the capability is not
correctly hex encoded, ignore it.

Before this patch, we echo:ed it back to the TTY inside an error
resonse.
</content>
</entry>
<entry>
<title>sixel: special case parsing of images with an aspect ratio of 1:1</title>
<updated>2023-06-29T13:40:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-27T12:25:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3555e81fee4a069bf4886007082f676b8777f6f9'/>
<id>urn:sha1:3555e81fee4a069bf4886007082f676b8777f6f9</id>
<content type='text'>
Images with an aspect ratio of 1:1 are by far the most common (though
not the default).

It makes a lot of sense, performance wise, to special case
them.

Specifically, the sixel_add() function benefits greatly from this, as
it is the inner most, most heavily executed function when parsing a
sixel image.

sixel_add_many() also benefits, since allows us to drop a
multiplication. Since sixel_add_many() always called first (no other
call sites call sixel_add() directly), this has a noticeable effect on
performance.

Another thing that helps (though not as much), and not specifically
with AR 1:1 images, is special casing DECGRI a bit.

Up until now, it simply updated the current sixel parameter value. The
problem is that the default parameter value is 0. But, a value of 0
should be treated as 1. By adding a special ‘repeat_count’ variable to
the sixel struct, we can initialize it to ‘1’ when we see DECGRI, and
then simply overwrite it as the parameter value gets updated. This
allows us to drop an if..else when emitting the sixel.
</content>
</entry>
<entry>
<title>config: add tweak option to allow disabling sixels</title>
<updated>2022-04-06T17:25:43Z</updated>
<author>
<name>jvoisin</name>
<email>julien.voisin@dustri.org</email>
</author>
<published>2022-02-27T15:29:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=58a1ffe72483ffb52d617d2985851781e82a45b8'/>
<id>urn:sha1:58a1ffe72483ffb52d617d2985851781e82a45b8</id>
<content type='text'>
Closes #950
</content>
</entry>
<entry>
<title>dcs: don’t automatically buffer anything</title>
<updated>2022-03-21T19:40:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-03-19T19:23:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=de5226c93007c588f28a12215796c462a05e5bdf'/>
<id>urn:sha1:de5226c93007c588f28a12215796c462a05e5bdf</id>
<content type='text'>
If a request handler doesn’t define its own put() handler, simply drop
all DCS parameter data. This way, we won’t end up allocating
potentially large buffers for unsupported/unimplemented DCS requests.

Closes #959
</content>
</entry>
<entry>
<title>dcs: xtgettcap: use custom put() handler</title>
<updated>2022-03-21T19:40:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-03-19T19:22:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=67a228bf4b8b826544c13dac561e4965750465d7'/>
<id>urn:sha1:67a228bf4b8b826544c13dac561e4965750465d7</id>
<content type='text'>
Grow buffer exponentially, since XTGETTCAP requests can,
theoretically, be very large.
</content>
</entry>
<entry>
<title>dcs: decrqss: use a custom put() handler</title>
<updated>2022-03-21T19:40:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-03-19T19:13:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=af88c19561e4083b569a3bded26faa8347c017be'/>
<id>urn:sha1:af88c19561e4083b569a3bded26faa8347c017be</id>
<content type='text'>
Only buffer up to two bytes, as that’s the largest DECRQSS request we
support.
</content>
</entry>
<entry>
<title>dcs: map BSU/ESU unhook handlers directly to term_{enable,disable}_app_sync_upates()</title>
<updated>2022-03-21T19:40:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-03-19T19:04:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8f064369859947fd039531c8e3239fe37656eac8'/>
<id>urn:sha1:8f064369859947fd039531c8e3239fe37656eac8</id>
<content type='text'>
That is, drop the local bsu() and esu() functions.
</content>
</entry>
<entry>
<title>dcs: prevent possibility of out-of-bounds reads in decrqss()</title>
<updated>2022-03-02T19:05:51Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2022-03-02T19:05:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cc8e86fd2d7c2e2527e0c77237ff815888008ac4'/>
<id>urn:sha1:cc8e86fd2d7c2e2527e0c77237ff815888008ac4</id>
<content type='text'>
This could be triggered by running, for example:

    printf '\033P$qrxyz\033\\'

...which would cause a memcmp() of 4 bytes on a 2 byte string literal.

Fixes: #960
</content>
</entry>
<entry>
<title>dcs: decrqss: refactor: append_sgr_attr_n() is now a proper function</title>
<updated>2022-01-14T13:09:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-14T13:09:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b292e735bb4240cda8ed31c8f4133784c6465350'/>
<id>urn:sha1:b292e735bb4240cda8ed31c8f4133784c6465350</id>
<content type='text'>
</content>
</entry>
<entry>
<title>dcs: decrqss: add note about Ps in the reply</title>
<updated>2022-01-14T12:52:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-13T14:46:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7243b094b7a1885b898b12464276c07b95c01bf2'/>
<id>urn:sha1:7243b094b7a1885b898b12464276c07b95c01bf2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>dcs: decrqss: BUG on invalid cursor style</title>
<updated>2022-01-14T12:52:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-13T14:43:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a8681ea44067208dd5692051fb084d2ed4c06a06'/>
<id>urn:sha1:a8681ea44067208dd5692051fb084d2ed4c06a06</id>
<content type='text'>
</content>
</entry>
<entry>
<title>dcs: implement DECRQSS</title>
<updated>2022-01-14T12:52:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-13T14:36:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=add530e66d7709543bad6f958002437eac71a80d'/>
<id>urn:sha1:add530e66d7709543bad6f958002437eac71a80d</id>
<content type='text'>
This patch adds support for DECRQSS (request Selection or Setting),
for the following sub-queries:

* DECSTBM   Set Top and Bottom Margins
* SGR       Set Graphic Rendition
* DECSCUSR  Set Cursor Style

Closes #798
</content>
</entry>
</feed>
