mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-17 01:50:05 +00:00
fixed #7481 - broadcast not available on SSH tabs
This commit is contained in:
parent
ac9595b06a
commit
d26ce6c316
@ -1,7 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||||
import { ConfigService, BaseTabComponent, TabContextMenuItemProvider, SplitTabComponent, NotificationsService, MenuItemOptions, ProfilesService, PromptModalComponent, TranslateService } from 'tabby-core'
|
import { ConfigService, BaseTabComponent, TabContextMenuItemProvider, NotificationsService, MenuItemOptions, ProfilesService, PromptModalComponent, TranslateService } from 'tabby-core'
|
||||||
import { MultifocusService } from 'tabby-terminal'
|
|
||||||
import { TerminalTabComponent } from './components/terminalTab.component'
|
import { TerminalTabComponent } from './components/terminalTab.component'
|
||||||
import { UACService } from './services/uac.service'
|
import { UACService } from './services/uac.service'
|
||||||
import { TerminalService } from './services/terminal.service'
|
import { TerminalService } from './services/terminal.service'
|
||||||
@ -66,7 +65,6 @@ export class NewTabContextMenu extends TabContextMenuItemProvider {
|
|||||||
private terminalService: TerminalService,
|
private terminalService: TerminalService,
|
||||||
private uac: UACService,
|
private uac: UACService,
|
||||||
private translate: TranslateService,
|
private translate: TranslateService,
|
||||||
private multifocus: MultifocusService,
|
|
||||||
) {
|
) {
|
||||||
super()
|
super()
|
||||||
}
|
}
|
||||||
@ -133,23 +131,6 @@ export class NewTabContextMenu extends TabContextMenuItemProvider {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tab instanceof TerminalTabComponent && tab.parent instanceof SplitTabComponent) {
|
|
||||||
items.push({
|
|
||||||
label: this.translate.instant('Focus all tabs'),
|
|
||||||
click: () => {
|
|
||||||
this.multifocus.focusAllTabs()
|
|
||||||
},
|
|
||||||
})
|
|
||||||
if (tab.parent.getAllTabs().length > 1) {
|
|
||||||
items.push({
|
|
||||||
label: this.translate.instant('Focus all panes'),
|
|
||||||
click: () => {
|
|
||||||
this.multifocus.focusAllPanes()
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return items
|
return items
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import { Injectable, Optional, Inject } from '@angular/core'
|
|||||||
import { BaseTabComponent, TabContextMenuItemProvider, NotificationsService, MenuItemOptions, TranslateService } from 'tabby-core'
|
import { BaseTabComponent, TabContextMenuItemProvider, NotificationsService, MenuItemOptions, TranslateService } from 'tabby-core'
|
||||||
import { BaseTerminalTabComponent } from './api/baseTerminalTab.component'
|
import { BaseTerminalTabComponent } from './api/baseTerminalTab.component'
|
||||||
import { TerminalContextMenuItemProvider } from './api/contextMenuProvider'
|
import { TerminalContextMenuItemProvider } from './api/contextMenuProvider'
|
||||||
|
import { MultifocusService } from './services/multifocus.service'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -45,24 +46,42 @@ export class CopyPasteContextMenu extends TabContextMenuItemProvider {
|
|||||||
export class MiscContextMenu extends TabContextMenuItemProvider {
|
export class MiscContextMenu extends TabContextMenuItemProvider {
|
||||||
weight = 1
|
weight = 1
|
||||||
|
|
||||||
constructor (private translate: TranslateService) { super() }
|
constructor (
|
||||||
|
private translate: TranslateService,
|
||||||
|
private multifocus: MultifocusService,
|
||||||
|
) { super() }
|
||||||
|
|
||||||
async getItems (tab: BaseTabComponent): Promise<MenuItemOptions[]> {
|
async getItems (tab: BaseTabComponent): Promise<MenuItemOptions[]> {
|
||||||
|
const items: MenuItemOptions[] = []
|
||||||
if (tab instanceof BaseTerminalTabComponent && tab.enableToolbar && !tab.pinToolbar) {
|
if (tab instanceof BaseTerminalTabComponent && tab.enableToolbar && !tab.pinToolbar) {
|
||||||
return [{
|
items.push({
|
||||||
label: this.translate.instant('Show toolbar'),
|
label: this.translate.instant('Show toolbar'),
|
||||||
click: () => {
|
click: () => {
|
||||||
tab.pinToolbar = true
|
tab.pinToolbar = true
|
||||||
},
|
},
|
||||||
}]
|
})
|
||||||
}
|
}
|
||||||
if (tab instanceof BaseTerminalTabComponent && tab.session?.supportsWorkingDirectory()) {
|
if (tab instanceof BaseTerminalTabComponent && tab.session?.supportsWorkingDirectory()) {
|
||||||
return [{
|
items.push({
|
||||||
label: this.translate.instant('Copy current path'),
|
label: this.translate.instant('Copy current path'),
|
||||||
click: () => tab.copyCurrentPath(),
|
click: () => tab.copyCurrentPath(),
|
||||||
}]
|
})
|
||||||
}
|
}
|
||||||
return []
|
items.push({
|
||||||
|
label: this.translate.instant('Focus all tabs'),
|
||||||
|
click: () => {
|
||||||
|
this.multifocus.focusAllTabs()
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if (tab.parent.getAllTabs().length > 1) {
|
||||||
|
items.push({
|
||||||
|
label: this.translate.instant('Focus all panes'),
|
||||||
|
click: () => {
|
||||||
|
this.multifocus.focusAllPanes()
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return items
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user