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);