mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-25 11:33:35 +03:00
bring window to front when called from CLI (fixes #489)
This commit is contained in:
parent
215ddf0eec
commit
4426d4827f
@ -224,6 +224,17 @@ export class Window {
|
||||
this.window.setTitle(title)
|
||||
})
|
||||
|
||||
ipcMain.on('window-bring-to-front', event => {
|
||||
if (event.sender !== this.window.webContents) {
|
||||
return
|
||||
}
|
||||
if (this.window.isMinimized()) {
|
||||
this.window.restore()
|
||||
}
|
||||
this.window.show()
|
||||
this.window.moveTop()
|
||||
})
|
||||
|
||||
this.window.webContents.on('new-window', event => event.preventDefault())
|
||||
}
|
||||
|
||||
|
@ -180,6 +180,10 @@ export class HostAppService {
|
||||
this.electron.ipcRenderer.send('app:ready')
|
||||
}
|
||||
|
||||
bringToFront () {
|
||||
this.electron.ipcRenderer.send('window-bring-to-front')
|
||||
}
|
||||
|
||||
quit () {
|
||||
this.logger.info('Quitting')
|
||||
this.electron.app.quit()
|
||||
|
@ -163,6 +163,7 @@ export default class TerminalModule {
|
||||
if (await fs.exists(directory)) {
|
||||
if ((await fs.stat(directory)).isDirectory()) {
|
||||
terminal.openTab(null, directory)
|
||||
hostApp.bringToFront()
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -172,10 +173,12 @@ export default class TerminalModule {
|
||||
command: command[0],
|
||||
args: command.slice(1),
|
||||
}, null, true)
|
||||
hostApp.bringToFront()
|
||||
})
|
||||
hostApp.cliPaste$.subscribe(text => {
|
||||
if (app.activeTab instanceof TerminalTabComponent && app.activeTab.session) {
|
||||
(app.activeTab as TerminalTabComponent).sendInput(text)
|
||||
hostApp.bringToFront()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user