some terminal session fixes

This commit is contained in:
Amrit Subramanian 2025-10-02 13:22:03 -04:00
parent 272f763e71
commit 7fd4968a35
2 changed files with 47 additions and 52 deletions

24
main.ts
View file

@ -5,18 +5,6 @@ import * as os from "os";
let mainWindow: BrowserWindow;
const terminals = new Map<string, pty.IPty>();
const createWindow = () => {
mainWindow = new BrowserWindow({
width: 1400,
height: 900,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
},
});
mainWindow.loadFile("index.html");
// Create new terminal
ipcMain.on("create-terminal", (event) => {
const terminalId = `terminal-${Date.now()}`;
@ -63,6 +51,18 @@ const createWindow = () => {
terminals.delete(terminalId);
}
});
const createWindow = () => {
mainWindow = new BrowserWindow({
width: 1400,
height: 900,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
},
});
mainWindow.loadFile("index.html");
};
app.whenReady().then(() => {

View file

@ -198,8 +198,3 @@ ipcRenderer.on("terminal-created", (_event, terminalId: string) => {
document.getElementById("new-terminal")?.addEventListener("click", () => {
ipcRenderer.send("create-terminal");
});
// Create first terminal on load
window.addEventListener("DOMContentLoaded", () => {
ipcRenderer.send("create-terminal");
});