slave: set $TERM_PROGRAM and $TERM_PROGRAM_VERSION environment variables

These are already being set by iTerm2, WezTerm, tmux and likely some
others. Even though using yet more environment variables seems rather
questionable, if we don't set these we run the risk of inheriting them
from other terminals.

See also:

* 97a6078df8/sources/PTYSession.m (L2568-2570)
* 1d0f68dee9/environ.c (L263-L264)
* https://github.com/search?q=TERM_PROGRAM&type=code
This commit is contained in:
Craig Barnes 2023-03-20 14:40:36 +00:00
parent 9f3ce9236f
commit 5b2f02d826
5 changed files with 28 additions and 0 deletions

View file

@ -546,6 +546,17 @@ In all other cases, the exit code is that of the client application
This variable is set to *truecolor*, to indicate to client
applications that 24-bit RGB colors are supported.
*TERM_PROGRAM*
Always set to *foot*. This can be used by client applications to
check which terminal is in use, but with the caveat that it may
have been inherited from a parent process in other terminals that
aren't known to set the variable.
*TERM_PROGRAM_VERSION*
Set to the foot version string, in the format _major_*.*_minor_*.*_patch_
or _major_*.*_minor_*.*_patch_*-*_revision_*-\g*_commit_ for inter-release
builds. The same caveat as for *TERM_PROGRAM* applies.
In addition to the variables listed above, custom environment
variables may be defined in *foot.ini*(5).

View file

@ -158,6 +158,17 @@ terminfo entries manually, by copying *foot* and *foot-direct* to
This variable is set to *truecolor*, to indicate to client
applications that 24-bit RGB colors are supported.
*TERM_PROGRAM*
Always set to *foot*. This can be used by client applications to
check which terminal is in use, but with the caveat that it may
have been inherited from a parent process in other terminals that
aren't known to set the variable.
*TERM_PROGRAM_VERSION*
Set to the foot version string, in the format _major_*.*_minor_*.*_patch_
or _major_*.*_minor_*.*_patch_*-*_revision_*-\g*_commit_ for inter-release
builds. The same caveat as for *TERM_PROGRAM* applies.
In addition to the variables listed above, custom environment
variables may be defined in *foot.ini*(5).