1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-22 11:52:03 +03:00

sftp: added "copy full path" context menu item - fixed #7013, fixed #6866

This commit is contained in:
Eugene Pankov 2023-01-08 20:26:22 +01:00
parent 1397d0faed
commit 62d2735f86
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -21,15 +21,21 @@ export class EditSFTPContextMenu extends SFTPContextMenuItemProvider {
}
async getItems (item: SFTPFile, panel: SFTPPanelComponent): Promise<MenuItemOptions[]> {
if (item.isDirectory) {
return []
}
return [
const items: MenuItemOptions[] = [
{
click: () => this.edit(item, panel.sftp),
label: this.translate.instant('Edit locally'),
click: () => this.platform.setClipboard({
text: item.fullPath,
}),
label: this.translate.instant('Copy full path'),
},
]
if (!item.isDirectory) {
items.push({
click: () => this.edit(item, panel.sftp),
label: this.translate.instant('Edit locally'),
})
}
return items
}
private async edit (item: SFTPFile, sftp: SFTPSession) {