diff --git a/tabby-ssh/src/components/sftpPanel.component.pug b/tabby-ssh/src/components/sftpPanel.component.pug index cbfa705d..151de0bd 100644 --- a/tabby-ssh/src/components/sftpPanel.component.pug +++ b/tabby-ssh/src/components/sftpPanel.component.pug @@ -17,6 +17,16 @@ button.btn.btn-link.btn-close((click)='close()') !{require('../../../tabby-core/src/icons/times.svg')} .body(dropZone, (transfer)='uploadOne($event)') + a.alert.alert-info.d-flex.align-items-center( + *ngIf='shouldShowCWDTip && !cwdDetectionAvailable', + (click)='platform.openExternal("https://tabby.sh/go/cwd-detection")' + ) + .mr-auto(translate) + strong(translate) Working directory detection + div(translate) Learn how to allow Tabby to detect remote shell's working directory. + button.close((click)='dismissCWDTip()') + i.fas.fa-close + div(*ngIf='!sftp', translate) Connecting div(*ngIf='sftp') div(*ngIf='fileList === null', translate) Loading diff --git a/tabby-ssh/src/components/sftpPanel.component.ts b/tabby-ssh/src/components/sftpPanel.component.ts index 5a792d4a..2c663fcc 100644 --- a/tabby-ssh/src/components/sftpPanel.component.ts +++ b/tabby-ssh/src/components/sftpPanel.component.ts @@ -26,11 +26,12 @@ export class SFTPPanelComponent { @Input() path = '/' @Output() pathChange = new EventEmitter() pathSegments: PathSegment[] = [] + @Input() cwdDetectionAvailable = false constructor ( private ngbModal: NgbModal, - private platform: PlatformService, private notifications: NotificationsService, + public platform: PlatformService, @Optional() @Inject(SFTPContextMenuItemProvider) protected contextMenuProviders: SFTPContextMenuItemProvider[], ) { this.contextMenuProviders.sort((a, b) => a.weight - b.weight) @@ -173,6 +174,14 @@ export class SFTPPanelComponent { this.platform.popupContextMenu(await this.buildContextMenu(item), event) } + get shouldShowCWDTip (): boolean { + return !window.localStorage.sshCWDTipDismissed + } + + dismissCWDTip (): void { + window.localStorage.sshCWDTipDismissed = 'true' + } + close (): void { this.closed.emit() } diff --git a/tabby-ssh/src/components/sshTab.component.pug b/tabby-ssh/src/components/sshTab.component.pug index c626b019..e5b85b70 100644 --- a/tabby-ssh/src/components/sshTab.component.pug +++ b/tabby-ssh/src/components/sshTab.component.pug @@ -41,6 +41,7 @@ sftp-panel.bg-dark( *ngIf='sftpPanelVisible', (click)='$event.stopPropagation()', [session]='sshSession', + [cwdDetectionAvailable]='session?.supportsWorkingDirectory()', (closed)='sftpPanelVisible = false' )