<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/main.c, branch 1.11.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.11.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.11.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2022-02-05T16:22:01Z</updated>
<entry>
<title>main: remove debug logging</title>
<updated>2022-02-05T16:22:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-02-05T16:22:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=844563a7916a6d176316aa733cb1968f68a7caf6'/>
<id>urn:sha1:844563a7916a6d176316aa733cb1968f68a7caf6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fcft: adapt to API changes in fcft-3.x</title>
<updated>2022-02-05T16:00:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-21T12:50:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e0227266cabc015c282774ac898e3f52dce943df'/>
<id>urn:sha1:e0227266cabc015c282774ac898e3f52dce943df</id>
<content type='text'>
Fcft no longer uses wchar_t, but plain uint32_t to represent
codepoints.

Since we do a fair amount of string operations in foot, it still makes
sense to use something that actually _is_ a string (or character),
rather than an array of uint32_t.

For this reason, we switch out all wchar_t usage in foot to
char32_t. We also verify, at compile-time, that char32_t used
UTF-32 (which is what fcft expects).

Unfortunately, there are no string functions for char32_t. To avoid
having to re-implement all wcs*() functions, we add a small wrapper
layer of c32*() functions.

These wrapper functions take char32_t arguments, but then simply call
the corresponding wcs*() function.

For this to work, wcs*() must _also_ be UTF-32 compatible. We can
check for the presence of the  __STDC_ISO_10646__ macro. If set,
wchar_t is at least 4 bytes and its internal representation is UTF-32.

FreeBSD does *not* define this macro, because its internal wchar_t
representation depends on the current locale. It _does_ use UTF-32
_if_ the current locale is UTF-8.

Since foot enforces UTF-8, we simply need to check if __FreeBSD__ is
defined.

Other fcft API changes:

* fcft_glyph_rasterize() -&gt; fcft_codepoint_rasterize()
* font.space_advance has been removed
* ‘tags’ have been removed from fcft_grapheme_rasterize()
* ‘fcft_log_init()’ removed
* ‘fcft_init()’ and ‘fcft_fini()’ must be explicitly called
</content>
</entry>
<entry>
<title>main: reset signal mask and signal handlers at startup</title>
<updated>2022-02-04T17:13:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-02-02T20:35:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8ca0eaa94c08961f955caf54bd5407d5ef53610b'/>
<id>urn:sha1:8ca0eaa94c08961f955caf54bd5407d5ef53610b</id>
<content type='text'>
This ensures processes spawned by us (e.g. the shell, new terminal
instances etc) don’t inherit a flawed signal mask, or having signals
unknowingly ignored.

Closes #854
</content>
</entry>
<entry>
<title>main: log locale errors (in addition to adding a user notification)</title>
<updated>2022-01-13T10:47:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-12T17:59:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d85feb02ed5d16fe55c7573bb4006b414b97d188'/>
<id>urn:sha1:d85feb02ed5d16fe55c7573bb4006b414b97d188</id>
<content type='text'>
</content>
</entry>
<entry>
<title>main: display warning only, when we succeed in enabling a fallback locale</title>
<updated>2022-01-13T10:47:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-12T14:53:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2bc77ebf096a7b96b5bd4553b83af42fe4084440'/>
<id>urn:sha1:2bc77ebf096a7b96b5bd4553b83af42fe4084440</id>
<content type='text'>
</content>
</entry>
<entry>
<title>main: try to force an UTF-8 locale if user’s locale isn’t UTF-8</title>
<updated>2022-01-13T10:47:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-11T20:37:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=827bfef5508ba454992011a61ca6c6e3ed4767f3'/>
<id>urn:sha1:827bfef5508ba454992011a61ca6c6e3ed4767f3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>main: present invalid locale errors as a user-notification</title>
<updated>2022-01-13T10:47:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-10T19:24:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9873d2732fb513737a2a17dfdfb9a6f2a6722ff8'/>
<id>urn:sha1:9873d2732fb513737a2a17dfdfb9a6f2a6722ff8</id>
<content type='text'>
Foot does not support running under non-UTF8 locales. If we detect a
non-UTF8 locale, we log this and exit with an error.

However, it appears a fairly common situation is this:

user (knowingly or unknowingly) only configures his/hers locale in
e.g. the shell RC files. These aren’t sourced when the compositor is
started via a display manager.

Thus, compositor key binds will fail to launch, and the user typically
has no way of seeing foot’s output.

So, the user proceeds to start another terminal, and from that one
tries launching foot. And it works... (because the shell in the other
terminal sourced the locale configuration).

User is left confused and often don’t know how to debug.

This patch is somewhat hackish; in addition to logging the locale
error, it also pushes a user notification. For this to be visible, we
need to actually start a terminal window.

So, we ignore the configured shell, and we ignore any custom command
line, and instead spawns “/bin/sh -c ‘’”. This allows us to get
something running (that hopefully doesn’t produce too much output we
can’t decode due to the non-UTF8 locale). But, it will exit
immediately. So we also set the --hold flag.

This works, and may be a good enough “solution”. However, it only
works for standalone foot instances, not footclients.
</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>config: csd.border_width now always reflects the full/total width</title>
<updated>2021-12-22T19:21:46Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-22T19:21:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=521bd84a99ee154af2866511774c1f6c8c2a2467'/>
<id>urn:sha1:521bd84a99ee154af2866511774c1f6c8c2a2467</id>
<content type='text'>
</content>
</entry>
<entry>
<title>main: ignore SIGPIPE</title>
<updated>2021-12-11T19:19:11Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-05T14:25:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e67639a6822c906b65b25850cd6c00738c2db648'/>
<id>urn:sha1:e67639a6822c906b65b25850cd6c00738c2db648</id>
<content type='text'>
We want to handle SIGPIPEs without crashing... One way to trigger this
was to use e.g.

  pipe-visible=[cat /foo/bar] Control+Shift+q

That is, pipe output to something that did not consume it. This led
to a SIGPIPE when we tried to write the terminal contents to the pipe,
and crashed the whole foot instance.
</content>
</entry>
<entry>
<title>main: improve handling of setlocale(3) return value</title>
<updated>2021-11-10T17:41:48Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-11-10T17:29:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0e5e68d82eac894483bb1b67a1b23b1972a9f045'/>
<id>urn:sha1:0e5e68d82eac894483bb1b67a1b23b1972a9f045</id>
<content type='text'>
There's no need to call setlocale() twice, since the first call
returns the same value as the second.

We also handle a NULL return value explicitly and show a distinct
error message for that case, since it typically indicates a
misconfigured locale and not just a non-UTF8 locale.
</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>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>main: verify primary font is monospaced at startup</title>
<updated>2021-08-31T17:58:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-31T17:42:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8ffc556d441013e06236f144020b91ea4e3a3f86'/>
<id>urn:sha1:8ffc556d441013e06236f144020b91ea4e3a3f86</id>
<content type='text'>
Load a couple of ASCII glyphs and check if their advance widths
matches. If not, warn the user that the font is probably not
monospaced.

This can be disabled by setting tweak.font-monospace-warn=no.

Closes #704.
</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>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>foot: add +/-graphemes to version output</title>
<updated>2021-06-24T15:50:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-24T15:50:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a319ddf094cd015673bb80e8137cbebaeaa2c26e'/>
<id>urn:sha1:a319ddf094cd015673bb80e8137cbebaeaa2c26e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>main: usage: add ‘=’ between --override and its value</title>
<updated>2021-06-23T13:12:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-23T12:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c6b5ac92997bab13c795543e0fa87d30cc812bc4'/>
<id>urn:sha1:c6b5ac92997bab13c795543e0fa87d30cc812bc4</id>
<content type='text'>
This is how all other long options are documented in the usage.
</content>
</entry>
</feed>
