mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-20 19:39:54 +00:00
22 lines
516 B
TypeScript
22 lines
516 B
TypeScript
import { Injectable } from '@angular/core'
|
|
import { HostAppService } from './api/hostApp'
|
|
import { CLIHandler, CLIEvent } from './api/cli'
|
|
|
|
@Injectable()
|
|
export class LastCLIHandler extends CLIHandler {
|
|
firstMatchOnly = true
|
|
priority = -999
|
|
|
|
constructor (private hostApp: HostAppService) {
|
|
super()
|
|
}
|
|
|
|
async handle (event: CLIEvent): Promise<boolean> {
|
|
if (event.secondInstance) {
|
|
this.hostApp.newWindow()
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
}
|