summary refs log tree commit diff
path: root/main.ts
diff options
context:
space:
mode:
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);