Merge branch 'master' of github.com:Eugeny/terminus

This commit is contained in:
Eugene Pankov
2021-01-24 19:27:42 +01:00
5 changed files with 20 additions and 7 deletions

View File

@@ -147,7 +147,7 @@ export class Application {
handleSecondInstance (argv: string[], cwd: string): void {
this.presentAllWindows()
this.windows[this.windows.length - 1].handleSecondInstance(argv, cwd)
this.windows[this.windows.length - 1].passCliArguments(argv, cwd, true)
}
private setupMenu () {

View File

@@ -53,7 +53,7 @@ if (argv.d) {
})
}
app.on('ready', () => {
app.on('ready', async () => {
if (process.platform === 'darwin') {
app.dock.setMenu(Menu.buildFromTemplate([
{
@@ -65,5 +65,8 @@ app.on('ready', () => {
]))
}
application.init()
application.newWindow({ hidden: argv.hidden })
const window = await application.newWindow({ hidden: argv.hidden })
await window.ready
window.passCliArguments(process.argv, process.cwd(), false)
})

View File

@@ -65,6 +65,7 @@ export class Window {
enableRemoteModule: true,
contextIsolation: false,
},
maximizable: true,
frame: false,
show: false,
backgroundColor: '#00000000',
@@ -229,8 +230,8 @@ export class Window {
}
}
handleSecondInstance (argv: string[], cwd: string): void {
this.send('host:second-instance', parseArgs(argv, cwd), cwd)
passCliArguments (argv: string[], cwd: string, secondInstance: boolean): void {
this.send('cli', parseArgs(argv, cwd), cwd, secondInstance)
}
private setupWindowManagement () {