<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/client.c, branch releases/1.12</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=releases%2F1.12</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=releases%2F1.12'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2022-04-12T13:07:41Z</updated>
<entry>
<title>client/slave: explictly add ‘extern char **environ’</title>
<updated>2022-04-12T13:07:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-11T11:24:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fd414f79be177b23a67ce87b81657c2bfd80a35e'/>
<id>urn:sha1:fd414f79be177b23a67ce87b81657c2bfd80a35e</id>
<content type='text'>
It’s not in any header files on FreeBSD.
</content>
</entry>
<entry>
<title>client: refactor: add send_string_list() function</title>
<updated>2022-04-12T13:07:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-11T10:38:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=261797ec5692b4958d806cf5f639f1cf8f890928'/>
<id>urn:sha1:261797ec5692b4958d806cf5f639f1cf8f890928</id>
<content type='text'>
Use it to send ‘overrides’ and ‘envp’
</content>
</entry>
<entry>
<title>client: add -E,--client-environment</title>
<updated>2022-04-12T13:07:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-11T10:19:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d02124902b4e27c3ed3ef48442ce17c5e0af9d56'/>
<id>urn:sha1:d02124902b4e27c3ed3ef48442ce17c5e0af9d56</id>
<content type='text'>
When this option is used, the child process in the new terminal
instance will inherit its environment from the footclient process,
instead of the foot server’s.

Implemented by sending (yet another) dynamic string list as part of
the client -&gt; server setup packet. When the new option is *not* used,
the setup packet is now 2 bytes larger than before.

On the server side, the slave process now uses execvpe() instead of
execvp(). There’s plumbing to propagate a new ‘envp’ argument from
term_init() all the way down to slave_exec(). If ‘envp’ is NULL, we
use ‘environ’ instead (thus matching the old behavior of execvp()).

Closes #1004
</content>
</entry>
<entry>
<title>Explicitly initialize sigaction::sa_mask members with sigemptyset(3)</title>
<updated>2022-02-12T12:26:42Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2022-02-12T12:04:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=23cf80667a36aaff1865fc50afab3f98a796cf14'/>
<id>urn:sha1:23cf80667a36aaff1865fc50afab3f98a796cf14</id>
<content type='text'>
Not doing so before calling sigaction(3) is "undefined" according to
POSIX[1]:

&gt; Applications shall call either sigemptyset() or sigfillset() at least
&gt; once for each object of type sigset_t prior to any other use of that
&gt; object. If such an object is not initialized in this way, but is
&gt; nonetheless supplied as an argument to any of pthread_sigmask(),
&gt; sigaction(), sigaddset(), sigdelset(), sigismember(), sigpending(),
&gt; sigprocmask(), sigsuspend(), sigtimedwait(), sigwait(), or
&gt; sigwaitinfo(), the results are undefined.

The use of designated initializers means that sa_mask members were
still being initialized, but sigset_t is an opaque type and implicit
initialization doesn't necessarily produce the same results as using
sigemptyset(3) (although it typically does on most implementations).

[1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaddset.html
</content>
</entry>
<entry>
<title>foot{,client}: handle argc == 0</title>
<updated>2022-01-01T20:17:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-01T20:11:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9f26b250bbc1d97f1093a0997bfd5ccc504a56b2'/>
<id>urn:sha1:9f26b250bbc1d97f1093a0997bfd5ccc504a56b2</id>
<content type='text'>
Our getopt_long() based argument parser would (correctly) break out of
the while loop immediately. However, we would then proceed and
decrement ‘argc’ by 1, resulting in it being -1.

This was then passed to the terminal constructor, which passed it on
to the client application fork+exec logic. That finally resulted in an
exec(3) failure:

   err: slave.c:339: SHELL=/bin/zsh: failed to execute: No such file or directory
   err: fdm.c:215: no such FD: 7
  info: main.c:604: goodbye
</content>
</entry>
<entry>
<title>foot/client: implement xdga client activation</title>
<updated>2021-11-01T01:52:29Z</updated>
<author>
<name>Ronan Pigott</name>
<email>rpigott@berkeley.edu</email>
</author>
<published>2021-10-29T00:51:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=99d5bf64bca5daa70e3e8c5a4d63a257ba7e6fb8'/>
<id>urn:sha1:99d5bf64bca5daa70e3e8c5a4d63a257ba7e6fb8</id>
<content type='text'>
This is an application of the xdg activation protocol that will allow
compositors to associate new foot toplevels with the command that
launched them.

footclient receives an activation token from the launcher which the
compositor can use to track application startup. It passes the token
to the foot server, which then activates the new window with the token
to complete the startup sequence.
</content>
</entry>
<entry>
<title>client: use MSG_NOSIGNAL in send(3)</title>
<updated>2021-10-30T16:07:06Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-10-30T16:07:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4607763e7972a1ce96d9082f4cee86d6dae5d90b'/>
<id>urn:sha1:4607763e7972a1ce96d9082f4cee86d6dae5d90b</id>
<content type='text'>
  MSG_NOSIGNAL  Requests not to send the SIGPIPE signal if an attempt
                to send is made on  a  stream-oriented socket that is
                no longer connected. The [EPIPE] error shall still be
                returned.
</content>
</entry>
<entry>
<title>client: handle partial writes in send(3)</title>
<updated>2021-10-29T19:44:34Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-10-29T19:42:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cad48c1b0a12bd4f484808ccafa981cf461849cf'/>
<id>urn:sha1:cad48c1b0a12bd4f484808ccafa981cf461849cf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>foot/client: version info: add +/- assertions</title>
<updated>2021-10-23T13:40:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-10-23T13:40:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3155ab45fe392f1dd4984f034d6048f8d79a2228'/>
<id>urn:sha1:3155ab45fe392f1dd4984f034d6048f8d79a2228</id>
<content type='text'>
</content>
</entry>
<entry>
<title>main/client: add no-op "-e" command-line option</title>
<updated>2021-09-18T22:40:40Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-09-18T22:40:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ef7919e64d09d4b29a1557641883e78f5896841d'/>
<id>urn:sha1:ef7919e64d09d4b29a1557641883e78f5896841d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>main/client: replace some uses of printf() with puts() in print_usage()</title>
<updated>2021-09-18T18:44:04Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-09-18T18:44:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=537cd9b367beece55691fb739f0834e2e96571b6'/>
<id>urn:sha1:537cd9b367beece55691fb739f0834e2e96571b6</id>
<content type='text'>
FOOT_DEFAULT_TERM is a string literal passed as a -D argument to
the compiler, so it can just be concatenated with the other string
literals, instead of being formatted with printf().
</content>
</entry>
<entry>
<title>terminfo: install to $datadir/foot/terminfo by default, append to TERMINFO_DIRS</title>
<updated>2021-08-17T19:04:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-07T14:42:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=76391868650240b2314a66d182e4d07cf8491f54'/>
<id>urn:sha1:76391868650240b2314a66d182e4d07cf8491f54</id>
<content type='text'>
As of 2021-07-31, ncurses ships its own version of foot’s terminfo.

Since:

* It doesn’t have the non-standard Sync,Tc,setrgbf,setrgbb
  capabilities.
* It doesn’t set hs,fsl,dsl (statusbar).
* We want to be able to update our termminfo without waiting for an
  ncurses release.
* Foot should be installable and usable on Linux systems that doesn’t
  have the latest ncurses.

we still want to ship our own version. We can however not install it
to the default terminfo location (e.g. /usr/share/terminfo), since it
will collide with the ncurses provided files.

Our options are to either rename our terminfo to something else, or to
keep the name, but install our terminfo files somewhere else.

The first option would be the easy one. However, I think it makes
sense to use the same name. For example, a user that SSH’s into a
remote system that does *not* have our own version installed,
but *does* have the ncurses one, will gracefully fall back to that
one, which is better than manually having to set
e.g. TERM=xterm-256color.

Now, if we want to use the same name, we need to install it somewhere
else. But where? And how do we ensure our version is preferred over
the ncurses one?

I opted to $datadir/foot/terminfo (e.g. /usr/share/foot/terminfo) by
default. It makes it namespaced to foot (i.e. we’re not introducing a
new “standard” terminfo location), thus guaranteeing it wont collide
with ncurses.

To enable applications to find it, we export TERMINFO_DIRS. This is a
list of *additional* directories to search for terminfo files. If it’s
already defined, we *append* to it.

The nice thing with this is, if there’s no terminfo in that
location (e.g. when you SSH into a remote), the default terminfo
location is *also* searched. But only *after* having searched through
TERMINFO_DIRS.

In short: our version is preferred, but the ncurses one (or an older
version of our terminfo package!) will be used if ours cannot be
found.

To enable packagers full control over the new behavior, the existing
meson command line options have been modified, and a new option added:

-Dterminfo=disabled|enabled|auto: *build* and *install* the terminfo
files.

-Dcustom-terminfo-install-location=&lt;path&gt;: *where* the terminfo files
are expected to be found.

This *needs* to be set *even* if -Dterminfo=disabled. For example, if
the packaging script builds and packages the terminfo files separate
from the regular foot build. The path is *relative to $prefix*, and
defaults to $datadir/foot/terminfo.

This is the value that will be appended to TERMINFO_DIRS. Note that
you can set it to ‘no’, in which case foot will *not* set/modify
TERMINFO_DIRS. Only do this if you don’t intend to package foot’s
terminfo files at all (i.e. you plan on using the ncurses ones only).

-Ddefault-terminfo=foot. Allows overriding the default TERM
value. This should only be changed if the target platform doesn’t
support terminfo files.

Closes #671
</content>
</entry>
<entry>
<title>client: remove info log of client app’s exit-code</title>
<updated>2021-07-30T13:38:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-30T13:38:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0b6ec4da71c4eb466303688e21230bce96945dcc'/>
<id>urn:sha1:0b6ec4da71c4eb466303688e21230bce96945dcc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>log: add LOG_CLASS_NONE and use as initializer for log_level</title>
<updated>2021-06-26T21:15:09Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-06-26T21:15:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5dca0458a09ebc586fda49c50533976f055d8de2'/>
<id>urn:sha1:5dca0458a09ebc586fda49c50533976f055d8de2</id>
<content type='text'>
This means that logging will be completely disabled until log_init()
has been called, which is useful to prevent log spam when running
UNITTEST{} blocks in debug builds.

Note that this doesn't change the default log level at runtime, which
was already being set to LOG_CLASS_INFO in main.c and client.c.

The new log level is also exposed to the command-line interface as
`--log-level=none`, which allows disabling logging entirely.
</content>
</entry>
<entry>
<title>client: add +/-graphemes to version output</title>
<updated>2021-06-24T15:50:44Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-24T15:50:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3f0f5ec3b7ee5bdbdc085f133920b83a611601b8'/>
<id>urn:sha1:3f0f5ec3b7ee5bdbdc085f133920b83a611601b8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>client: make sure ‘fd’ is initialized in all error paths</title>
<updated>2021-06-23T13:32:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-23T13:32:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=15e7e802456404d077bc23c6de01b5979f0a7484'/>
<id>urn:sha1:15e7e802456404d077bc23c6de01b5979f0a7484</id>
<content type='text'>
</content>
</entry>
<entry>
<title>client: add and use function push_override()</title>
<updated>2021-06-23T13:12:09Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-23T13:04:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5fc8275eb2385933a1f068a4476ddfc28afce584'/>
<id>urn:sha1:5fc8275eb2385933a1f068a4476ddfc28afce584</id>
<content type='text'>
We now track override data (length + malloc:ed string) in a struct,
and push this struct to our overrides linked list.

There’s a new function, push_override() that takes a string,
calculates its length, strdup() it and pushes it to the linked
list. This function also length-checks the string, to ensure we don’t
overflow.

This way, we don’t have to loop the overrides list twice; once when
calculating the total length of all overrides, and once when sending
the overrides to the server.

Now, we can update the total length as we add overrides (i.e while
parsing the command line, instead of afterwards).

This means we only have to loop the list once, and that’s when sending
it. This also means there’s no longer any need to malloc an array
holding the lengths of each override.
</content>
</entry>
<entry>
<title>client: implement -o,--override</title>
<updated>2021-06-23T13:12:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-23T12:34:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=63a64bdca1978814ade32949e4cbf0d9758e6cbe'/>
<id>urn:sha1:63a64bdca1978814ade32949e4cbf0d9758e6cbe</id>
<content type='text'>
</content>
</entry>
<entry>
<title>client: send overrides for everything that is publicly visible in the conf</title>
<updated>2021-06-23T13:12:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-23T12:22:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=136d60606a1e01eb68ed984de63b7a55f8966075'/>
<id>urn:sha1:136d60606a1e01eb68ed984de63b7a55f8966075</id>
<content type='text'>
Send a generic “overrides” list to the server, containing options in
text, on the format “section.key=value”.

This reduces the size of the base client/server protocol packet, as
well as opens up for a generic -o,--override command line option (not
yet implemented).
</content>
</entry>
<entry>
<title>main/client: change exit code</title>
<updated>2021-05-04T08:41:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-01T08:46:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=da923100cad1000252c87b02a4132ce5878a28ec'/>
<id>urn:sha1:da923100cad1000252c87b02a4132ce5878a28ec</id>
<content type='text'>
* foot exits with -26/230
* footclient exits with -36/220

This is to give each application a range of exit codes. Currently
unused, but we may want to change this in the future.
</content>
</entry>
</feed>
