mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
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)