Fixed title leading whitespace

pull/138/head
aristocratos 2020-09-27 22:01:22 +02:00
parent 45b103adb1
commit 1d7688820c
1 changed files with 4 additions and 2 deletions

View File

@ -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