summary refs log tree commit diff
path: root/screen.ts
diff options
context:
space:
mode:
Diffstat (limited to 'screen.ts')
-rw-r--r--screen.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/screen.ts b/screen.ts
index 7d47412..69e3e1d 100644
--- a/screen.ts
+++ b/screen.ts
@@ -10,7 +10,7 @@ import process from "node:process";
 const logs: string[] = [];
 
 function onexit() {
-    console.clear()
+    // console.clear()
     console.log("\nQuitting meower CL")
     for (const log of logs) {
         console.log(log)
@@ -22,9 +22,11 @@ export class Screen {
     name: string;
     focusedElementId: string = '';
     logs = logs
+    client;
 
-    constructor(name: string) {
+    constructor(name: string, client: any) {
         this.name = name;
+        this.client = client
     }
 
     call(function_name:string, ...args:any) {
@@ -37,6 +39,7 @@ export class Screen {
     handleKeypress(_chunk: Buffer, key: Key, screen: Screen) {
         const focusableIDs = Object.keys(screen.getFocusable());
         const focusedIndex = focusableIDs.indexOf(screen.focusedElementId);
+        // console.debug(this.client.ws.readyState)
         if (key && key.name == 'escape' || key.name == "c" && key.ctrl) {
             onexit();
             Deno.exit(0);
@@ -81,6 +84,8 @@ export class Screen {
     }
 
     render() {
+        // console.debug('render')
+        // return;
         console.clear()
         process.stdout.write("\u001b[2J") // use an ansi escape code to clear the screen if console.clear doesn't clear fully
         this.elements.forEach(element => {