@@ -90,10 +90,9 @@ const attach = (event, webContents) => {
9090 // - if it's a remote host, open in external browser
9191 webContents . opened = true
9292 } else {
93- console . log ( "will-navigate" , { event, url } )
93+ // console.log("will-navigate", { event, url })
9494 let host = new URL ( url ) . host
9595 let localhost = new URL ( root_url ) . host
96- console . log ( { host, localhost } )
9796 if ( host !== localhost ) {
9897 event . preventDefault ( )
9998 shell . openExternal ( url ) ;
@@ -590,7 +589,17 @@ document.querySelector("form").addEventListener("submit", (e) => {
590589 if ( BrowserWindow . getAllWindows ( ) . length === 0 ) createWindow ( PORT )
591590 } )
592591 app . on ( 'window-all-closed' , function ( ) {
593- if ( process . platform !== 'darwin' ) app . quit ( )
592+ console . log ( "window-all-closed" )
593+ if ( process . platform !== 'darwin' ) {
594+ // Reset all shells before quitting
595+ pinokiod . kernel . shell . reset ( )
596+ // wait 1 second before quitting the app
597+ // otherwise the app.quit() fails because the subprocesses are running
598+ setTimeout ( ( ) => {
599+ console . log ( "app.quit()" )
600+ app . quit ( )
601+ } , 1000 )
602+ }
594603 } )
595604 app . on ( 'browser-window-created' , ( event , win ) => {
596605 if ( win . type !== "splash" ) {
0 commit comments