From e1715f2bc5adb2d9ae8376058ec8c5416878e622 Mon Sep 17 00:00:00 2001 From: superlopez-real Date: Thu, 30 Jun 2022 12:45:48 +0100 Subject: [PATCH] fixed terminal resizing with full screen CLIs --- index.js | 4 ++++ main.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/index.js b/index.js index faa828b..dc704db 100644 --- a/index.js +++ b/index.js @@ -72,3 +72,7 @@ term.onData((e) => { ipc.send("terminal.keystroke", e); }); console.log(bgColor); + +term.onResize(function (size) { + ipc.send("terminal.resize", size); +}); diff --git a/main.js b/main.js index 4ae9f33..4a9ec08 100644 --- a/main.js +++ b/main.js @@ -61,6 +61,10 @@ function createWindow() { ipcMain.on("terminal.keystroke", (event, key) => { ptyProcess.write(key); }); + ipcMain.on("terminal.resize", (event, size) => { + ptyProcess.resize(size.cols, size.rows); + console.log("resized"); + }); } app.on("ready", createWindow);