diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-16 18:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-16 18:19:03 +0000 |
commit | 2b689e3af421bdd35ccd34cdc733d4d8a40843b3 (patch) | |
tree | dc0754b353914d026743560b8fa8977dc407fe99 /src/shared/ptyfwd.c | |
parent | Releasing progress-linux version 256.1-2~progress7.99u1. (diff) | |
download | systemd-2b689e3af421bdd35ccd34cdc733d4d8a40843b3.tar.xz systemd-2b689e3af421bdd35ccd34cdc733d4d8a40843b3.zip |
Merging upstream version 256.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/shared/ptyfwd.c')
-rw-r--r-- | src/shared/ptyfwd.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/shared/ptyfwd.c b/src/shared/ptyfwd.c index 998ce96..842aef9 100644 --- a/src/shared/ptyfwd.c +++ b/src/shared/ptyfwd.c @@ -17,6 +17,7 @@ #include "sd-event.h" #include "alloc-util.h" +#include "env-util.h" #include "errno-util.h" #include "extract-word.h" #include "fd-util.h" @@ -367,6 +368,21 @@ static int insert_background_fix(PTYForward *f, size_t offset) { return insert_string(f, offset, s); } +bool shall_set_terminal_title(void) { + static int cache = -1; + + if (cache >= 0) + return cache; + + cache = getenv_bool("SYSTEMD_ADJUST_TERMINAL_TITLE"); + if (cache == -ENXIO) + return (cache = true); + if (cache < 0) + log_debug_errno(cache, "Failed to parse $SYSTEMD_ADJUST_TERMINAL_TITLE, leaving terminal title setting enabled: %m"); + + return cache != 0; +} + static int insert_window_title_fix(PTYForward *f, size_t offset) { assert(f); |