From e47c3b6c573cc81b092f844a237163eb2384eb83 Mon Sep 17 00:00:00 2001 From: Anjan Nath Date: Fri, 4 Mar 2022 19:56:45 +0530 Subject: [PATCH 1/2] remove reloading of webcontent handler on did-fail-load event this does not fix the issue as reported in: https://github.com/code-ready/tray-electron/issues/185 --- src/main.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main.ts b/src/main.ts index 5976d5a..64f286b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -176,12 +176,6 @@ if (!gotTheLock) { } }) - app.on('browser-window-focus', (e, w) => { - w.webContents.on('did-fail-load', () => { - w.webContents.reload() - }) - }) - app.whenReady().then(async () => { if (needOnboarding()) { showOnboarding() From 5ce2a23d1b91c6e240adc18afbffbf4a024e5f59 Mon Sep 17 00:00:00 2001 From: Anjan Nath Date: Fri, 4 Mar 2022 20:05:05 +0530 Subject: [PATCH 2/2] use crc instead of absolute path to crc --- src/main.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 64f286b..9501c78 100644 --- a/src/main.ts +++ b/src/main.ts @@ -458,11 +458,14 @@ const prepareDevTerminalForPreset = async function(preset: DevTerminalType) { default: return false } - //TODO: use iterm or iterm2 for macOS + if (isWin) { var poshPath = which.sync("powershell.exe", { nothrow: true }) + + //TODO: use absolute path for crc binary + var cmd = `-NoExit -Command "&{crc ${command} | Invoke-Expression}"` if (poshPath !== null) { - const posh = childProcess.spawn(poshPath, [`-NoExit -command "&'${crcBinary()} ${command} | Invoke-Expression'"`], { + const posh = childProcess.spawn(poshPath, [cmd], { detached: true, shell: true, cwd: os.homedir(),