From 1d7688820ce4ad41016afc3bc761ed44c517f462 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Sun, 27 Sep 2020 22:01:22 +0200 Subject: [PATCH] Fixed title leading whitespace --- bpytop.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bpytop.py b/bpytop.py index be6e723..b57e23b 100755 --- a/bpytop.py +++ b/bpytop.py @@ -613,8 +613,10 @@ class Term: @staticmethod def title(text: str = "") -> str: - if text: text = f' {text}' - return f'\033]0;{os.environ.get("TERMINAL_TITLE", "")}{text}\a' + out: str = f'{os.environ.get("TERMINAL_TITLE", "")}' + if out and text: out += " " + if text: out += f'{text}' + return f'\033]0;{out}\a' class Fx: """Text effects