From 9434066546a8409117083bd64ad43f97a3a236e2 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 29 Aug 2021 11:06:45 +0200 Subject: meson: terminfo install location now defaults to $datadir/terminfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The meson command line option -Dcustom-terminfo-install-location has been changed in the following ways: * If unset, $datadir/terminfo is used, and TERMINFO is *not* exported * If set, that value (relative to $prefix) is used, and TERMINFO *is* exported. * The special value ‘no’ is removed. -Ddefault-terminfo now also changes the terminfo names generated when -Dterminfo=enabled. Furthermore, the documentation for the TERMINFO environment variable has been removed from the foot.1 and footclient.1 man pages (but as mentioned above, foot *will* still set it if -Dcustom-terminfo-install-location has been used). INSTALL.md has been updated to now recommend using ncurses’ terminfo definitions, if available. But also to document the other alternatives; installing the terminfo definitions in a custom location, or installing them with a diferent name. It also describes the general problem, and the disadvantages of each alternative (but without going into too much depth). --- INSTALL.md | 93 +++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 41 deletions(-) (limited to 'INSTALL.md') diff --git a/INSTALL.md b/INSTALL.md index 81e9ec3e..6a380803 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -128,23 +128,35 @@ reasons for this: used by e.g. tmux. * New capabilities added to the `xterm-256color` terminfo could potentially break foot. +* There may be future additions or changes to foot’s terminfo. -As of ncurses 2021-07-31, ncurses ships a version of foot’s -terminfo. I still recommend building and installing the version -shipped with foot, since: +As of ncurses 2021-07-31, ncurses includes a version of foot’s +terminfo. **The recommendation is to use those**, and only install the +terminfo definitions from this git repo if the system’s ncurses +predates 2021-07-31. -* It will be more up to date (and more importantly, guaranteed to - match the installed version of foot). -* The ncurses version is missing several of the non-standard capabilities. +But, note that the foot terminfo definitions in ncurses’ lack the +non-standard capabilities. This mostly affects tmux; without them, +`terminal-overrides` must be configured to enable truecolor +support. For this reason, it _is_ possible to install “our” terminfo +definitions as well, either in a non-default location, or under a +different name. -Foot’s terminfo will by default be built, and installed along with -foot itself. This can be disabled (for example, to simplify packaging -when the terminfo definitions are packaged in a separate -package). Instructions on how to do so is in [terminfo](#terminfo). +Both have their set of issues. When installing to a non-default +location, foot will set the environment variable `TERMINFO` in the +child process. However, there are many situations where this simply +does not work. See https://codeberg.org/dnkl/foot/issues/695 for +details. -I recommend packaging foot’s terminfo files in a separate package, to -allow them to be installed on remote systems without having to install -foot itself. +Installing them under a different name generally works well, but will +break applications that check if `$TERM == foot`. + +Hence the recommendation to simply use ncurses’ terminfo definitions +if available. + +If packaging “our” terminfo definitions, I recommend doing that as a +separate package, to allow them to be installed on remote systems +without having to install foot itself. ### Setup @@ -158,44 +170,43 @@ mkdir -p bld/release && cd bld/release Available compile-time options: -| Option | Type | Default | Description | Extra dependencies | -|--------------------------------------|---------|----------------------------|----------------------------------|--------------------| -| `-Ddocs` | feature | `auto` | Builds and install documentation | scdoc | -| `-Dime` | bool | `true` | Enables IME support | None | -| `-Dgrapheme-clustering` | feature | `auto` | Enables grapheme clustering | libutf8proc | -| `-Dterminfo` | feature | `enabled` | Build and install terminfo files | tic (ncurses) | -| `-Ddefault-terminfo` | string | `foot` | Default value of `TERM` | none | -| `-Dcustom-terminfo-install-location` | string | `${datadir}/foot/terminfo` | Value to set `TERMINFO` to | None | +| Option | Type | Default | Description | Extra dependencies | +|--------------------------------------|---------|-----------------------|----------------------------------|--------------------| +| `-Ddocs` | feature | `auto` | Builds and install documentation | scdoc | +| `-Dime` | bool | `true` | Enables IME support | None | +| `-Dgrapheme-clustering` | feature | `auto` | Enables grapheme clustering | libutf8proc | +| `-Dterminfo` | feature | `enabled` | Build and install terminfo files | tic (ncurses) | +| `-Ddefault-terminfo` | string | `foot` | Default value of `TERM` | none | +| `-Dcustom-terminfo-install-location` | string | `${datadir}/terminfo` | Value to set `TERMINFO` to | None | Documentation includes the man pages, the example `foot.ini`, readme, changelog and license files. `-Ddefault-terminfo`: I strongly recommend leaving the default -value. This option is meant to be used as a last resort on platforms -where individual terminfo files cannot easily be installed. +value. Use this option if you plan on installing the terminfo files +under a different name. Setting this changes the default value of +`$TERM`, and the names of the terminfo files (if +`-Dterminfo=enabled`). `-Dcustom-terminfo-install-location` enables foot’s terminfo to -co-exist with ncurses’ version. The idea is that you install foot’s -terminfo to a non-standard location, for example -`/usr/share/foot/terminfo`. Use `-Dcustom-terminfo-install-location` -to tell foot where the terminfo is. Foot will set the environment -variable `TERMINFO` to this value (with `${prefix}` added). The value -is **relative to ${prefix}**. - -Conforming applications _should_ look in `TERMINFO` first, and -fallback to the builtin default (e.g. `/usr/share/terminfo`) if not -found. Thus, it will prefer foot’s version, if it exists (which it -typically will on localhost), and fallback to ncurses’ version if not -(e.g. on remote systems, where foot’s terminfo package has not been -installed). - -If set to `no`, foot will **not** set or modify `TERMINFO` at all. Use -this if you do not intend to use/support foot’s terminfo definitions -at all. +co-exist with ncurses’ version, without changing the terminfo +names. The idea is that you install foot’s terminfo to a non-standard +location, for example `/usr/share/foot/terminfo`. Use +`-Dcustom-terminfo-install-location` to tell foot where the terminfo +is. Foot will set the environment variable `TERMINFO` to this value +(with `${prefix}` added). The value is **relative to ${prefix}**. + +Note that there are several issues with this approach: +https://codeberg.org/dnkl/foot/issues/695. + +If left unset, foot will **not** set or modify `TERMINFO`. `-Dterminfo` can be used to disable building the terminfo definitions in the meson build. It does **not** change the default value of -`TERM`, and it does **not** disable `TERMINFO`. +`TERM`, and it does **not** disable `TERMINFO`, if +`-Dcustom-terminfo-install-location` has been set. Use this if +packaging the terminfo definitions in a separate package (and the +build script isn’t shared with the ‘foot’ package). Example: -- cgit v1.3