<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/csi.c, branch 1.6.3</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.6.3</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.6.3'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-01-21T10:57:46Z</updated>
<entry>
<title>Add xsnprintf() and remove some unnecessary strlen(3) calls</title>
<updated>2021-01-21T10:57:46Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-01-14T21:30:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d2c00d73ec087e2266d8e07daacb0732fc1ca761'/>
<id>urn:sha1:d2c00d73ec087e2266d8e07daacb0732fc1ca761</id>
<content type='text'>
</content>
</entry>
<entry>
<title>vt: don’t ignore extra private/intermediate characters</title>
<updated>2020-12-16T13:30:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-16T13:30:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2e137c0a7e747a781ec311c6aad656873072b96c'/>
<id>urn:sha1:2e137c0a7e747a781ec311c6aad656873072b96c</id>
<content type='text'>
Take ‘\E(#0’ for example - this is *not* the same as ‘\E(0’.

Up until now, foot has however treated them as the same escape,
because the handler for ‘\E(0’ didn’t verify there weren’t any _other_
private characters present.

Fix this by turning the ‘private’ array into a single 4-byte
integer. This allows us to match *all* privates with a single
comparison.

Private characters are added to the LSB first, and MSB last. This
means we can check for single privates in pretty much the same way as
before:

  switch (term-&gt;vt.private) {
  case ‘?’:
      ...
      break;
  }

Checking for two (or more) is much uglier, but foot only supports
a *single* escape with two privates, and no escapes with three or
more:

  switch (term-&gt;vt.private) {
  case 0x243f:  /* ‘?$’ */
      ...
      break;
  }

The ‘clear’ action remains simple (and fast), with a single write
operation.

Collecting privates is potentially _slightly_ more complex than
before; we now need mask and compare, instead of simply comparing,
when checking how many privates we already have.

We _could_ add a counter, which would make collecting privates easier,
but this would add an additional write to the ‘clean’ action which is
really bad since it’s in the hot path.
</content>
</entry>
<entry>
<title>csi: implement DECRQM (DEC modes), for real</title>
<updated>2020-12-16T12:57:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-16T12:57:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=db097891f2c50020cd5f690d0613eacbf4b5f884'/>
<id>urn:sha1:db097891f2c50020cd5f690d0613eacbf4b5f884</id>
<content type='text'>
Previously, we always returned ‘2 - reset’, instead of the actual
state of the requested mode.
</content>
</entry>
<entry>
<title>csi: SGR 21 is “double underline”, not “disable bold” (according to ECMA-48)</title>
<updated>2020-12-14T18:10:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-14T18:10:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=04703c07f0db9e933ceda549f40cf5f30a46a724'/>
<id>urn:sha1:04703c07f0db9e933ceda549f40cf5f30a46a724</id>
<content type='text'>
</content>
</entry>
<entry>
<title>csi: fix sub-parameter versions of 38/48 SGR escapes</title>
<updated>2020-12-12T19:55:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-12T19:50:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9f321e60303d76c40eeff1bea931fbbead6434ff'/>
<id>urn:sha1:9f321e60303d76c40eeff1bea931fbbead6434ff</id>
<content type='text'>
Well this is embarrassing; the sub-parameter versions of the 38/48 SGR
escapes all required an extra ‘:2’ that wasn’t supposed to be there,
causing all the other sub-parameters to be shifted one step to the
right.

That is, foot expected e.g. 38:2:2:r:g:b, or 38:2:5:idx when the
correct sequences are 38:2:cs:r:g:b and 38:5:idx.

I.e. I mixed up the color-space ID (cs) of 38:2 with *type* of color:
RGB or indexed.

In addition to fixing this, this patch also adds support for a
“bastard” version of the sub-parameter based RGB escapes, where the
color-space identifier has been left out: e.g. 38:2:r:g:b. This
sequence is invalid, but applications tend to “forget” the color-space
ID...
</content>
</entry>
<entry>
<title>csi: ‘CSI s’ and ‘CSI u’ now saves/restores attributes and charsets</title>
<updated>2020-12-11T19:01:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-11T19:01:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=975e70dae1d94e425745fd6b6447d4e3f748b75b'/>
<id>urn:sha1:975e70dae1d94e425745fd6b6447d4e3f748b75b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>config: add ‘notify’ to possible values for ‘bell’ in foot.ini</title>
<updated>2020-12-10T17:22:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-10T17:22:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=15d20af2a24664b09604f1ec5f121c38f1500c32'/>
<id>urn:sha1:15d20af2a24664b09604f1ec5f121c38f1500c32</id>
<content type='text'>
When `bell=notify`, foot will trigger a desktop notification when it
receives a BEL in an unfocused window.
</content>
</entry>
<entry>
<title>csi: add DECSET 737769 - enables/disables IME input</title>
<updated>2020-12-07T19:44:12Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-04T20:26:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0536bc41f4c3538aa1ad4cd68a5339de6a5a8613'/>
<id>urn:sha1:0536bc41f4c3538aa1ad4cd68a5339de6a5a8613</id>
<content type='text'>
73 77 69 = I M E
</content>
</entry>
<entry>
<title>csi: add new private mode that makes the Escape key emit "\E[27;1;27~"</title>
<updated>2020-11-29T04:04:57Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-11-29T04:04:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=31c73f0cf01e1d0bdcd1435136b010c1c1ab442c'/>
<id>urn:sha1:31c73f0cf01e1d0bdcd1435136b010c1c1ab442c</id>
<content type='text'>
This mode can be set by client programs with the DECSET, DECRST,
XTSAVE and XTRESTORE sequences by using 27127 as the parameter.

The sequence "\E[27;1;27~" is encoded in the same way as is done by
xterm's "modifyOtherKeys" mode. Even though xterm itself never emits
such a sequence for the Escape key, many programs already have
support for parsing this style of key sequence.
</content>
</entry>
<entry>
<title>term: split cursor blink state into two</title>
<updated>2020-11-26T17:09:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-11-26T17:09:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cb2f4962697ee62b9f6f403522e8a2ae7f213f9f'/>
<id>urn:sha1:cb2f4962697ee62b9f6f403522e8a2ae7f213f9f</id>
<content type='text'>
There are two different escape sequences that can be used to set the
cursor blink state: ‘CSI ? 12 h/l’ and ‘CSI Ps SP q’.

Up until now, they both modified the same internal state in foot. This
meant you could enable a blinking cursor with e.g. ‘CSI ? 12 h’ and
then disable it with ‘CSI 2 SP q’.

Since the ‘CSI ? 12’ escapes are used in the civis/cnorm/cvvis
terminfo entries, applications often ended up disabling the blink
state on exit (typically be emitting ‘cnorm’), requiring users to
manually re-enable blinking.

By splitting the internal state into two separate states, we can
improve the situation.

The cursor will blink if at least one of the two have been enabled.

The setting in foot.ini sets the default state of the ‘CSI Ps SP q’
escape.

This means if the user has enabled blinking in the configuration, the
cursor will blink regardless of civis/cnorm/cvvis. Which probably is
what the user wants.

If the user has NOT enabled blinking, civis/cnorm/cvvis act as
intended: cvvis blink, civis and cnorm do not.

If an application overrides the cursor blink/style with ‘CSI Ps SP q’,
that will override the user’s setting in foot.ini. But most likely
that too is intended (for example, the user may have configured the
application to use a different cursor style). And, a well written
application will emit the ‘Se’ terminfo sequence on exit, which in
foot is defined to ‘CSI SP q’, which will reset both the style and
blink state to the user configured style/state.

Closes #218
</content>
</entry>
<entry>
<title>term: remove read-only properties copied from the config</title>
<updated>2020-11-26T17:08:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-11-26T17:08:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=360cc8e6de8802015b3a4a744289c311beb8d82d'/>
<id>urn:sha1:360cc8e6de8802015b3a4a744289c311beb8d82d</id>
<content type='text'>
Use the config directly instead.
</content>
</entry>
<entry>
<title>csi: implement “CSI ? 1035” - toggle Num Lock override</title>
<updated>2020-11-11T17:26:47Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-11-11T17:26:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2382d6b4487cc9d599578034db8117eb3f1cc75f'/>
<id>urn:sha1:2382d6b4487cc9d599578034db8117eb3f1cc75f</id>
<content type='text'>
This adds a num_lock_modifier state to the terminal, and hooks up
“CSI?1035h/l” to toggle it.
</content>
</entry>
<entry>
<title>csi: implement ‘CSI ? 1042 h/l’ - enable/disable bell-is-urgent</title>
<updated>2020-10-11T15:44:29Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-11T15:44:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=17761dce63100d287b62dda5bf2c49d5db5f2576'/>
<id>urn:sha1:17761dce63100d287b62dda5bf2c49d5db5f2576</id>
<content type='text'>
</content>
</entry>
<entry>
<title>csi: only respond to Primary DA when Ps == 0</title>
<updated>2020-10-09T16:53:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-09T16:53:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5b0af8ed59c86cfe02bee65f9078ccf9920eb0be'/>
<id>urn:sha1:5b0af8ed59c86cfe02bee65f9078ccf9920eb0be</id>
<content type='text'>
</content>
</entry>
<entry>
<title>bell: optionally render margins in red when receiving BEL</title>
<updated>2020-10-08T17:55:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-08T17:55:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7c6686221f328e9399eb679c246662c801b2356b'/>
<id>urn:sha1:7c6686221f328e9399eb679c246662c801b2356b</id>
<content type='text'>
Add anew config option, ‘bell=none|set-urgency’. When set to
‘set-urgency’, the margins will be painted in red (if the window did
not have keyboard focus).

This is intended as a cheap replacement for the ‘urgency’ hint, that
doesn’t (yet) exist on Wayland.

Closes #157
</content>
</entry>
<entry>
<title>csi: xtrestore: add ‘reverse wrap’</title>
<updated>2020-10-03T09:53:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-03T09:53:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=71c54fb87cc3386210980be4c996f5319672deff'/>
<id>urn:sha1:71c54fb87cc3386210980be4c996f5319672deff</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: add private mode flag ‘’reverse-wrap’</title>
<updated>2020-10-02T19:29:56Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-01T18:15:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=060be30803b10c8ea2893e3ec880a46451d3cfe8'/>
<id>urn:sha1:060be30803b10c8ea2893e3ec880a46451d3cfe8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>csi: avoid using memcmp() to compare timespec structs</title>
<updated>2020-08-23T02:08:35Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-23T02:08:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0e7723e75fe7432974b3f6995b0b72b5c0c1184c'/>
<id>urn:sha1:0e7723e75fe7432974b3f6995b0b72b5c0c1184c</id>
<content type='text'>
This struct may contain padding bytes, whose values are indeterminate
after any store operation[1]. It may also contain unnamed members,
whose values are always indeterminate[2]. Using memcmp() isn't a
reliable way to compare structs where either of these may be present.

[1]: ISO/IEC 9899:1999 §6.2.6.1, paragraph 6
[2]: ISO/IEC 9899:1999 §6.7.8, paragraph 9

See also:

* https://wiki.sei.cmu.edu/confluence/display/c/EXP42-C.+Do+not+compare+padding+data
* https://sourceware.org/git/?p=glibc.git;a=blob;f=time/bits/types/struct_timespec.h;hb=756c306502498f9
</content>
</entry>
<entry>
<title>csi: add 2 missing "break" statements in csi_dispatch()</title>
<updated>2020-08-18T19:49:44Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-18T19:49:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7c58648238fb0b8a48fd3a912b34f4111d5eb31e'/>
<id>urn:sha1:7c58648238fb0b8a48fd3a912b34f4111d5eb31e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>csi: xtrestore: add 'default' case</title>
<updated>2020-08-18T19:14:05Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-08-18T19:14:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a48578c857a5ba6e9941a1a62542651af3f74ee8'/>
<id>urn:sha1:a48578c857a5ba6e9941a1a62542651af3f74ee8</id>
<content type='text'>
Don't call decset_decrst() with an unhandled parameter (and with
'enabled' uninitialized!)
</content>
</entry>
</feed>
