summary refs log tree commit diff
path: root/screen/home.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 /screen/home.ts
parentf473bfa775e51c88fd5d23d0565b3da05134afc4 (diff)
theoretically change window title
Diffstat (limited to 'screen/home.ts')
-rw-r--r--screen/home.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/screen/home.ts b/screen/home.ts
index c6f6c19..296fec2 100644
--- a/screen/home.ts
+++ b/screen/home.ts
@@ -3,6 +3,14 @@ import { Screen } from "../screen.ts";
 import type { Input, Text } from "../elements.ts";
 import process from "node:process";
 
+function changeTitle(title: string) {
+    if (process.platform == 'win32') {
+        process.title = title;
+    } else {
+        process.stdout.write(`\x1b]2;${title}\x1b\x5c`);
+    }
+}
+
 export default {
     elements: [
         {
@@ -49,5 +57,6 @@ export default {
     onload (screen: Screen) {
         screen.client.setScreen(screen)
         screen.client.loadHome(screen)
+        changeTitle(`maelink - home`)
     }
 }
\ No newline at end of file