Skip to content

Commit

Permalink
✨ window titles
Browse files Browse the repository at this point in the history
  • Loading branch information
haliphax committed Oct 12, 2023
1 parent 0aae27d commit d0b74a9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions userland/scripts/lock_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions userland/scripts/oneliners.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions userland/scripts/top.py
Original file line number Diff line number Diff line change
Expand Up @@ -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[/] ",
Expand All @@ -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:[/] ",
Expand Down
1 change: 1 addition & 0 deletions xthulu/ssh/process_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ async def main_process():
cx.stack = []

if proc.channel:
cx.term.set_window_title("")
proc.channel.close()

proc.close()
Expand Down

0 comments on commit d0b74a9

Please sign in to comment.