Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
fix linux relaunch sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
pompurin404 committed Sep 24, 2024
1 parent 46351b3 commit 7e5db87
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createTray } from './resolve/tray'
import { init } from './utils/init'
import { join } from 'path'
import { initShortcut } from './resolve/shortcut'
import { execSync } from 'child_process'
import { execSync, spawn } from 'child_process'
import { createElevateTask } from './sys/misc'
import { initProfileUpdater } from './core/profileUpdater'
import { existsSync, writeFileSync } from 'fs'
Expand Down Expand Up @@ -48,6 +48,18 @@ if (!gotTheLock) {
app.quit()
}

export function customRelaunch(): void {
spawn('sh', ['-c', `"sleep 1 && ${process.argv.join(' ')} & disown && exit"`], {
shell: true,
detached: true,
stdio: 'ignore'
})
}

if (process.platform === 'linux') {
app.relaunch = customRelaunch
}

if (process.platform === 'win32') {
// https://github.com/electron/electron/issues/43278
// https://github.com/electron/electron/issues/36698
Expand Down

0 comments on commit 7e5db87

Please sign in to comment.