Skip to content

Commit

Permalink
sftp: added "copy full path" context menu item - fixed #7013, fixed #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Jan 8, 2023
1 parent 1397d0f commit 62d2735
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tabby-electron/src/sftpContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 62d2735

Please sign in to comment.