<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/vt.c, branch 1.7.2</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.7.2</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.7.2'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-04-18T18:08:13Z</updated>
<entry>
<title>term/vt: only do reverse-wrapping (‘bw’) on cub1</title>
<updated>2021-04-18T18:08:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-04-08T10:58:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=24e88dd224888c6fa7d621e4871e81b45ea22b50'/>
<id>urn:sha1:24e88dd224888c6fa7d621e4871e81b45ea22b50</id>
<content type='text'>
Foot currently does reverse-wrapping (‘auto_left_margin’, or ’bw’) on
everything that calls ‘term_cursor_left()’. This is wrong; it should
only be done for cub1. From man terminfo:

    auto_left_margin | bw | bw | cub1 wraps from column 0 to last
    column

This patch moves the reverse-wrapping logic from term_cursor_left() to
the handling of BS (backspace).

Closes #441
</content>
</entry>
<entry>
<title>term: runtime switch between a ‘fast’ and a ‘generic’ ASCII print function</title>
<updated>2021-03-16T07:45:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-03-14T18:19:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=60b3ccc64115fb7e4b303eb1b93ba16d10fff1b5'/>
<id>urn:sha1:60b3ccc64115fb7e4b303eb1b93ba16d10fff1b5</id>
<content type='text'>
term_print() is called whenever the client application “prints”
something to the grid. It is called for both ASCII and UTF-8
characters, and needs to handle sixels, insert mode and ASCII
vs. graphical charsets.

Since it’s on the hot path, this becomes unnecessarily slow.

This patch adds a “fast” version of term_print(), tailored for the
common case: ASCII characters in non-insert mode, without any sixels
and non-graphical charsets.

A new function, term_update_ascii_printer(), has been added, and must
be called whenever:

* The currently selected charset *index* changes
* The currently selected charset changes (from ASCII to graphical, or
  vice verse)
* Sixels are added to the grid
* Sixels are removed from the grid
* Insert mode is enabled/disabled
</content>
</entry>
<entry>
<title>vt: remove xassert(), that cannot be optimized out, from action_print()</title>
<updated>2021-02-07T10:14:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-07T10:14:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cb60ddd0905f5fb92007037e3b10f8336da0e769'/>
<id>urn:sha1:cb60ddd0905f5fb92007037e3b10f8336da0e769</id>
<content type='text'>
action_print() is in the hot path, and having if-statement here *does*
have an impact on performance.

Much more so when that if-statement involves a functional call to
wcwidth().

Closes #330
</content>
</entry>
<entry>
<title>debug: rename assert() to xassert(), to avoid clashing with &lt;assert.h&gt;</title>
<updated>2021-01-16T20:16:00Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-01-16T20:16:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e56136ce1192d04a52b01ccb41284f0b7896430e'/>
<id>urn:sha1:e56136ce1192d04a52b01ccb41284f0b7896430e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Print stack trace on assert() failure or when calling fatal_error()</title>
<updated>2021-01-16T19:56:33Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-01-15T20:39:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=22f25a9e4feddbc093ae01cd53bdda3c2c3a82e9'/>
<id>urn:sha1:22f25a9e4feddbc093ae01cd53bdda3c2c3a82e9</id>
<content type='text'>
Note: this uses the __sanitizer_print_stack_trace() function from the
AddressSanitizer runtime, so it only works when AddressSanitizer is
in use.
</content>
</entry>
<entry>
<title>Merge branch 'decset-1047-and-1048'</title>
<updated>2021-01-16T14:27:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-16T14:27:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bcf46d9eab5cd9d96c4de473cb2c5281cdf8e0f6'/>
<id>urn:sha1:bcf46d9eab5cd9d96c4de473cb2c5281cdf8e0f6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>vt: document correct BS behavior, and why we do differently</title>
<updated>2021-01-15T17:40:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-15T17:40:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bc053e4879958b53a0db089282c8a044757e5754'/>
<id>urn:sha1:bc053e4879958b53a0db089282c8a044757e5754</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term/vt/csi: break out cursor save/restore to dedicated functions</title>
<updated>2021-01-15T16:08:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-15T16:08:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bae3c871bb6f05271adba8885b394b86ba0798a8'/>
<id>urn:sha1:bae3c871bb6f05271adba8885b394b86ba0798a8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use wrappers from macros.h instead of bare GCC attributes/pragmas</title>
<updated>2021-01-03T08:56:47Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-01-03T08:56:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=39b2e46e72ad82ec2971b859eae75562751f8464'/>
<id>urn:sha1:39b2e46e72ad82ec2971b859eae75562751f8464</id>
<content type='text'>
</content>
</entry>
<entry>
<title>vt: codespell: ony -&gt; only</title>
<updated>2020-12-16T14:06:34Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-16T14:06:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=69cd5fd3ab38fa98a62cae3a46edef0916dd84f5'/>
<id>urn:sha1:69cd5fd3ab38fa98a62cae3a46edef0916dd84f5</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>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>vt: BS: *only* reset lcf if cursor is beyond right margin: don’t move cursor</title>
<updated>2020-10-02T19:40:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-02T19:40:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=377f1b7ad3176d12ae274ca9f3b26f7b764493c7'/>
<id>urn:sha1:377f1b7ad3176d12ae274ca9f3b26f7b764493c7</id>
<content type='text'>
This is needed to make reverse auto-wrap work correctly. Without it,
we’ll end up moving the cursor left one cell extra.
</content>
</entry>
<entry>
<title>vt: hide pedantic warnings around the VT state machine's switch cases</title>
<updated>2020-08-23T08:07:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-08-23T07:38:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9db78c3122fd3dcd87c1b60ea41f3ad74ff227ba'/>
<id>urn:sha1:9db78c3122fd3dcd87c1b60ea41f3ad74ff227ba</id>
<content type='text'>
The switch statements use the GCC extension "case X ... Y", and here
it doesn't really make any sense to convert it to "case X: case Y:",
so hide the warnings instead.
</content>
</entry>
<entry>
<title>Fix spelling mistake in vt.c</title>
<updated>2020-08-16T13:37:27Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-16T13:37:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=44499bbfe13c5e021949ed9cde2d109da17e5bfc'/>
<id>urn:sha1:44499bbfe13c5e021949ed9cde2d109da17e5bfc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Convert most dynamic allocations to use functions from xmalloc.h</title>
<updated>2020-08-08T19:37:57Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-08T19:34:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7a77958ba20c2b344be5e66e69e2f212a4bbf6b3'/>
<id>urn:sha1:7a77958ba20c2b344be5e66e69e2f212a4bbf6b3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>vt: never call term_print() with a width &lt;= 0</title>
<updated>2020-07-16T06:04:12Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-16T06:04:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6f2cffd8c0949c2dfa1499c5d0c2594eb645ac26'/>
<id>urn:sha1:6f2cffd8c0949c2dfa1499c5d0c2594eb645ac26</id>
<content type='text'>
</content>
</entry>
<entry>
<title>vt: ignore 0x7f (DEL) in ground state</title>
<updated>2020-07-16T06:01:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-16T06:01:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9508804b18270ab47c750dc61a16384297c06aa7'/>
<id>urn:sha1:9508804b18270ab47c750dc61a16384297c06aa7</id>
<content type='text'>
This ensures *all* bytes mapped to action_print() have wcwidth == 1.

DEL has wcwidth == -1, and would thus have been ignored by
term_print() anwyway.
</content>
</entry>
<entry>
<title>vt: utf8: handle multi-column spacer values correctly when combining</title>
<updated>2020-07-16T05:41:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-16T05:41:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6183f7f64a10465b429f70c713102ced2e0517bc'/>
<id>urn:sha1:6183f7f64a10465b429f70c713102ced2e0517bc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: rename COMB_CHARS_LO,HI -&gt; CELL_COMB_CHARS_LO,HI</title>
<updated>2020-07-14T14:41:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-14T14:41:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5c99e8013b3e8fb68e55250be550e856636ccf7b'/>
<id>urn:sha1:5c99e8013b3e8fb68e55250be550e856636ccf7b</id>
<content type='text'>
</content>
</entry>
</feed>
