Adding SIGINT handler clears window content


#1

I added a handler on SIGINT event and after I run the app and press ctrl+c the content of the window becomes blank. Dunno why. See the code:

main.js

let electron = require('electron');
let app = electron.app;
let ipc = electron.ipcMain;
let BrowserWindow = electron.BrowserWindow;

app.on('ready', function() {
    console.log('ready');

    mainWindow = new BrowserWindow({ width: 800, height: 600 });
    mainWindow.loadURL('file://' + __dirname + '/index.html');
});

// Quit when all windows are closed.
app.on('window-all-closed', function() {
    console.log('window-all-closed');
    app.quit();
});

process.on('SIGINT', () => {
    console.log('SIGINT');
});

index.html

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    Hello world
</body>
</html>