<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/slave.c, branch 1.8.2</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.8.2</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.8.2'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-06-20T12:19:22Z</updated>
<entry>
<title>tokenize: strdup() each individual argv</title>
<updated>2021-06-20T12:19:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-20T12:17:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=42ec2640753650c69385d86c2fbb386d23965c89'/>
<id>urn:sha1:42ec2640753650c69385d86c2fbb386d23965c89</id>
<content type='text'>
Instead of referencing the un-tokenized “raw” command string, strdup()
each argv. This way, the input string can be ‘const’.
</content>
</entry>
<entry>
<title>slave/spawn: restore SIGHUP handler after fork(), before exec()</title>
<updated>2021-06-02T18:13:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-02T15:48:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a72b2688bda87a20d029e80eaf8d6686ca95003e'/>
<id>urn:sha1:a72b2688bda87a20d029e80eaf8d6686ca95003e</id>
<content type='text'>
Foot installs a SIG_IGN handler for SIGHUP. Ignored signals are
inherited in sub-processes. Thus, we need to restore it to SIG_DFL
before exec:ing.
</content>
</entry>
<entry>
<title>notifications: use \e[22m to disable bold</title>
<updated>2021-05-20T15:51:04Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-20T15:51:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b75bd6507a970520784791a6ff6beb1cf771077b'/>
<id>urn:sha1:b75bd6507a970520784791a6ff6beb1cf771077b</id>
<content type='text'>
\e[21m was previously used to disable bold. That changed a while ago,
to align foot with the majority of other terminal emulators.

\e[22m now disables both bold and dim.

When this change was done, the user notifications were not updated,
meaning the ‘message’ part was always in bold. This was never the
intended behavior.
</content>
</entry>
<entry>
<title>errno: don’t use ‘_errno’ as a variable name; _ are reserved for use as identifiers</title>
<updated>2021-02-21T19:33:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-21T19:33:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=555f751f94a7efa90f03713a876f41f2424ea9f0'/>
<id>urn:sha1:555f751f94a7efa90f03713a876f41f2424ea9f0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>spawn/slave: restore signal mask after fork</title>
<updated>2021-02-21T18:59:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-21T10:57:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dd5c31657ee934c52f24fd77778c56468d668b45'/>
<id>urn:sha1:dd5c31657ee934c52f24fd77778c56468d668b45</id>
<content type='text'>
slave: no need to restore signal handlers; they are automatically
restored as long as they are not SIG_IGN (which they never are in
foot).

spawn(): restore signal mask after fork. This fixes an issue where a
terminal spawned with ctrl+shift+n did not terminate when its shell
exited.

Closes #366
</content>
</entry>
<entry>
<title>Mark slave_exec() as "noreturn" and convert xassert(false) to BUG(...)</title>
<updated>2021-02-10T09:18:50Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-02-10T09:18:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=19a5f25b80f44e5440a444df8af443d0081e46bf'/>
<id>urn:sha1:19a5f25b80f44e5440a444df8af443d0081e46bf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>slave: skip e310487dae99 if not supported</title>
<updated>2021-01-21T11:00:02Z</updated>
<author>
<name>Jan Beich</name>
<email>jbeich@FreeBSD.org</email>
</author>
<published>2021-01-19T15:09:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=67e713ff3adc1f94087d1016e775d20f89a8675d'/>
<id>urn:sha1:67e713ff3adc1f94087d1016e775d20f89a8675d</id>
<content type='text'>
slave.c:188:26: error: use of undeclared identifier 'IUTF8'
        flags.c_iflag |= IUTF8;
                         ^
</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>log: include 'fmt' in __VA_ARGS__</title>
<updated>2020-08-23T08:07:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-08-23T05:44:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c779a5ec7deecf91cb9aca298af90cbc2d9c04d7'/>
<id>urn:sha1:c779a5ec7deecf91cb9aca298af90cbc2d9c04d7</id>
<content type='text'>
This ensures all calls have at least one __VA_ARGS__ argument, thus
making them ISO C99 compliant.
</content>
</entry>
<entry>
<title>slave: set $COLORTERM environment variable to "truecolor"</title>
<updated>2020-08-23T04:33:48Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-23T04:31:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=26fccae03dba5ca9a827d42c4c20ab373bb1e425'/>
<id>urn:sha1:26fccae03dba5ca9a827d42c4c20ab373bb1e425</id>
<content type='text'>
This is also done by libvte, alacritty, kitty and several other
terminal emulators as a way to indicate support for 24-bit RGB
colors. It generally also implies support for the xterm 256-color
palette and basic ECMA-48 colors.
</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>Replace non-portable "\e" escape in string literals with "\033"</title>
<updated>2020-08-02T22:54:04Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-02T22:54:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=11a1d99da732cad13995dcbfc04b6559b5255d01'/>
<id>urn:sha1:11a1d99da732cad13995dcbfc04b6559b5255d01</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Revert "slave: use an event FD to communicate errors after fork before exec"</title>
<updated>2020-08-01T07:41:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-08-01T07:41:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bae3244ec6344bf0d28a01fa06895b9ad2d6c293'/>
<id>urn:sha1:bae3244ec6344bf0d28a01fa06895b9ad2d6c293</id>
<content type='text'>
This reverts commit 027a8de6f547115fd90b8ee612fc616b61d5000c.

I was a bit quick on this one, and only tested error cases. Turns out,
this causes foot to hang in a blocking read(3) on the event FD.

This is because while the FD has FD_CLOEXEC, that flag is per file
descriptor. I.e. the forked copy of the event fd is closed when we
exec(), but since this isn't a pipe, nothing is signaled to the parent
process, which thus remains blocking in read(3) since its copy of the
event fd hasn't been closed.

We _could_ write a dummy value on the event fd just before exec(), but
then we wouldn't be able to catch errors from exec() self - only
errors *before* exec().
</content>
</entry>
<entry>
<title>slave: use an event FD to communicate errors after fork before exec</title>
<updated>2020-08-01T07:33:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-08-01T07:33:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=027a8de6f547115fd90b8ee612fc616b61d5000c'/>
<id>urn:sha1:027a8de6f547115fd90b8ee612fc616b61d5000c</id>
<content type='text'>
Replace the pipe we used to communicate errors after fork(), but
before exec() to the parent process with an event FD.

The overhead in the kernel is much lower to setup an event fd,
compared to a pipe.
</content>
</entry>
<entry>
<title>slave: emit user-notifications before dup:ing stdin/stdout/stderr</title>
<updated>2020-08-01T07:00:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-08-01T07:00:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c8e78674ed3fb19bab55cfbdac5db8a320e8e721'/>
<id>urn:sha1:c8e78674ed3fb19bab55cfbdac5db8a320e8e721</id>
<content type='text'>
Since we need to restore the status flags anyway, there's nothing to
gain from emitting the user notifications after dup:ing the pts file
descriptor.

On the other hand, emitting user notifications *before* dup:ing means
we can still print error messages for e.g. write(3) errors.
</content>
</entry>
<entry>
<title>slave: user-notifications: skip the O_NONBLOCK dance when there aren't any notifications</title>
<updated>2020-07-31T17:52:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-31T17:52:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7e93405b1a987c8d1aef17ba348ce9bb746ffa9a'/>
<id>urn:sha1:7e93405b1a987c8d1aef17ba348ce9bb746ffa9a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>slave: restore pts file status flags after emitting user-notifications</title>
<updated>2020-07-31T16:13:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-31T16:13:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1da8142f324d6011a60c19b77be24a6faf00180e'/>
<id>urn:sha1:1da8142f324d6011a60c19b77be24a6faf00180e</id>
<content type='text'>
We (need to) set O_NONBLOCK on the pts file description before
emitting the user-notifications, to ensure we don't block in write(3).

However, since file status flags are per *file*, not per
file *descriptor*, this ends up setting O_NONBLOCK on the dup:ed
stdin/stdout/stderr file descriptors too.

Not all clients want this, or can handle this.

Thus we need to restore the original flags before exec:ing the client.

This fixes "makepkg" build failures.
</content>
</entry>
<entry>
<title>slave: user-notifications: don't block in write(3)</title>
<updated>2020-07-31T15:15:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-31T15:15:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a7d21c5c7f02241732818d747d4ee27f54a65c5f'/>
<id>urn:sha1:a7d21c5c7f02241732818d747d4ee27f54a65c5f</id>
<content type='text'>
The main process is blocking and waiting for us to close the error
pipe (in exec(3), via O_CLOEXEC).

Thus, pts data will *not* be processed until we've exec:d the shell.

Because of this we must not write too much and block in write(3). Do
this by setting O_NONBLOCK on the pts fd (*after* dup:ing it to
stdin/stderr/sdout) and watch for EAGAIN EWOULDBLOCK.
</content>
</entry>
<entry>
<title>slave: user-notifications: emit errors first, then warnings and last deprecations</title>
<updated>2020-07-31T15:10:39Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-07-31T15:10:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b661513245e5bc07358237a39e4d100d124f64fc'/>
<id>urn:sha1:b661513245e5bc07358237a39e4d100d124f64fc</id>
<content type='text'>
</content>
</entry>
</feed>
