]> git.ipfire.org Git - thirdparty/systemd.git/commit
run: tweak logic how we set $TERM for activated services
authorLennart Poettering <lennart@poettering.net>
Fri, 31 Jan 2025 14:06:34 +0000 (15:06 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 27 Feb 2025 14:13:15 +0000 (15:13 +0100)
commit4d6eb6441a5332c285e35907894c7d4f3463ba64
tree4fc93ad13bf24776b12326fa8424d9f6e76cb143
parentdadbb34919abd3fefeb5b8ccc9794da9398a2503
run: tweak logic how we set $TERM for activated services

There are two cases when we invoke a service on a TTY:

1. We ourselves are connected to a TTY and would intend to enable PTY
   forwarding.
2. We are allocating a TTY but are not ourselves connected to a TTY and
   just want to input/output to pipe or other non-TTY fd.

Let's propagate $TERM only as-is in the first case. In the 2nd case,
let's explicitly set $TERM to "dumb", so that invoked progams do not
issue needless ansi sequences, since we are not propagating them to a
terminal either.

This should be a much safer result, for cases where people include
invocations of systemd-nspawn with full TTY allocation in a shell
pipeline or so.

(of course, the user can always explicitly override this)
src/run/run.c