mirror of
https://github.com/Eugeny/tabby
synced 2025-03-05 07:37:15 +00:00
26 lines
732 B
TypeScript
26 lines
732 B
TypeScript
import { Injectable } from '@angular/core'
|
|
import { ToolbarButtonProvider, IToolbarButton, AppService } from 'api'
|
|
import { SessionsService } from './services/sessions'
|
|
import { TerminalTab } from './tab'
|
|
|
|
|
|
@Injectable()
|
|
export class ButtonProvider extends ToolbarButtonProvider {
|
|
constructor (
|
|
private app: AppService,
|
|
private sessions: SessionsService,
|
|
) {
|
|
super()
|
|
}
|
|
|
|
provide (): IToolbarButton[] {
|
|
return [{
|
|
icon: 'plus',
|
|
title: 'New terminal',
|
|
click: async () => {
|
|
let session = await this.sessions.createNewSession({ command: 'zsh' })
|
|
this.app.openTab(new TerminalTab(session))
|
|
}
|
|
}]
|
|
}
|
|
}
|