From d0b74a989defc1affd1c972108e11131f295d2bf Mon Sep 17 00:00:00 2001 From: haliphax Date: Thu, 12 Oct 2023 16:30:13 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20window=20titles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- userland/scripts/lock_example.py | 1 + userland/scripts/oneliners.py | 1 + userland/scripts/top.py | 3 +++ xthulu/ssh/process_factory.py | 1 + 4 files changed, 6 insertions(+) diff --git a/userland/scripts/lock_example.py b/userland/scripts/lock_example.py index c1bea02..b908d3c 100644 --- a/userland/scripts/lock_example.py +++ b/userland/scripts/lock_example.py @@ -5,6 +5,7 @@ async def main(cx: SSHContext): + cx.term.set_window_title("locks example") cx.echo("\n[bright_white on yellow underline] Shared locks demo [/]\n\n") with cx.lock("testing") as l: diff --git a/userland/scripts/oneliners.py b/userland/scripts/oneliners.py index 6dbb054..447cba1 100644 --- a/userland/scripts/oneliners.py +++ b/userland/scripts/oneliners.py @@ -176,6 +176,7 @@ def on_resize(self, event: events.Resize) -> None: async def main(cx: SSHContext): + cx.term.set_window_title("oneliners") db = Resources().db oneliners: list[Oneliner] = [ oneliner diff --git a/userland/scripts/top.py b/userland/scripts/top.py index 871f709..e0d3cf2 100644 --- a/userland/scripts/top.py +++ b/userland/scripts/top.py @@ -20,9 +20,11 @@ async def main(cx: SSHContext): ) return + cx.term.set_window_title(f"{cx.username}@79columns") await scroll_art(cx, "userland/artwork/login.ans", "amiga") await cx.inkey("Press any key to continue", "dots8Bit") + cx.term.set_window_title("system information") await scroll_art(cx, "userland/artwork/sysinfo.ans", "amiga") cx.echo( ":skull: [bold bright_green]x[/][green]thulu[/] ", @@ -32,6 +34,7 @@ async def main(cx: SSHContext): await cx.redirect(["/bin/ash", "-c", "uname -a; echo -e '\\r'; sleep 0.1"]) await cx.inkey("Press any key to continue", "arc") + cx.term.set_window_title("logging in...") bar_text = "".join( [ "[bright_white]Connecting:[/] ", diff --git a/xthulu/ssh/process_factory.py b/xthulu/ssh/process_factory.py index 6fce29e..ed59765 100644 --- a/xthulu/ssh/process_factory.py +++ b/xthulu/ssh/process_factory.py @@ -122,6 +122,7 @@ async def main_process(): cx.stack = [] if proc.channel: + cx.term.set_window_title("") proc.channel.close() proc.close()