diff options
author | WlodekM <[email protected]> | 2025-01-24 17:38:33 +0200 |
---|---|---|
committer | WlodekM <[email protected]> | 2025-01-24 18:03:39 +0200 |
commit | 2d75c97ed1783331d8e12cd4f6456e88b80c73f6 (patch) | |
tree | 6271da5dc479d9f8cee8f4459194d55acb6c41a5 /screen.ts | |
parent | 5deacee61b572d7a83225073567b4758d1854adf (diff) |
working maelink client
Diffstat (limited to 'screen.ts')
-rw-r--r-- | screen.ts | 9 |
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 => { |