mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Merge branch 'master' into lens_restructure
# Conflicts: # Makefile # dashboard/yarn.lock # package.json # yarn.lock
This commit is contained in:
commit
e8624c845a
11 files changed
+132
-87
No files matched your search
+17
-4
@@ -160,7 +160,7 @@ export class ShellSession extends EventEmitter {
|
||||
}
|
||||
|
||||
protected exit(code = 1000) {
|
||||
this.websocket.close(code)
|
||||
if (this.websocket.readyState == this.websocket.OPEN) this.websocket.close(code)
|
||||
this.emit('exit')
|
||||
}
|
||||
|
||||
@@ -180,12 +180,25 @@ export class ShellSession extends EventEmitter {
|
||||
|
||||
protected exitProcessOnWebsocketClose() {
|
||||
this.websocket.on("close", () => {
|
||||
if (this.shellProcess) {
|
||||
this.shellProcess.kill();
|
||||
}
|
||||
this.killShellProcess()
|
||||
})
|
||||
}
|
||||
|
||||
protected killShellProcess(){
|
||||
if(this.running) {
|
||||
// On Windows we need to kill the shell process by pid, since Lens won't respond after a while if using `this.shellProcess.kill()`
|
||||
if (process.platform == "win32") {
|
||||
try {
|
||||
process.kill(this.shellProcess.pid)
|
||||
} catch(e) {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
this.shellProcess.kill()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected sendResponse(msg: string) {
|
||||
this.websocket.send("1" + Buffer.from(msg).toString("base64"))
|
||||
}
|
||||
|
||||
@@ -26,7 +26,10 @@ export class WindowManager {
|
||||
center: true,
|
||||
frame: false,
|
||||
resizable: false,
|
||||
show: false
|
||||
show: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
if (showSplash) {
|
||||
this.splashWindow.loadFile(path.join(__static, "/splash.html"))
|
||||
|
||||
Reference in new issue
Block a user