summary refs log tree commit diff
path: root/main.ts
diff options
context:
space:
mode:
authorWlodekM <[email protected]>2025-01-24 19:47:56 +0200
committerWlodekM <[email protected]>2025-01-24 19:47:56 +0200
commitb4f992ffdac2d3d7f1dcb1042a3b663c2643809a (patch)
tree57c911b7021b688b9873319d9eebb43f734e533b /main.ts
parentf473bfa775e51c88fd5d23d0565b3da05134afc4 (diff)
theoretically change window title
Diffstat (limited to 'main.ts')
-rw-r--r--main.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/main.ts b/main.ts
index 4fe68ff..922b47a 100644
--- a/main.ts
+++ b/main.ts
@@ -4,10 +4,20 @@ import { build } from "./screenbuilder.ts";
 import readline from 'node:readline';
 import * as client from "./client.ts"
 
+function changeTitle(title: string) {
+    if (process.platform == 'win32') {
+        process.title = title;
+    } else {
+        process.stdout.write(`\x1b]2;${title}\x1b\x5c`);
+    }
+}
+
 readline.emitKeypressEvents(process.stdin);
 
 if (process.stdin.isTTY) process.stdin.setRawMode(true); // makes the terminal send stdin without the user pressing enter
 
+changeTitle(`maelink`)
+
 let screen;
 try {
     screen = build(LoginScreen, client);