diff --git a/tabby-electron/src/index.ts b/tabby-electron/src/index.ts index 975a1623..c443298c 100644 --- a/tabby-electron/src/index.ts +++ b/tabby-electron/src/index.ts @@ -1,6 +1,6 @@ import { NgModule } from '@angular/core' import { PlatformService, LogService, UpdaterService, DockingService, HostAppService, ThemesService, Platform, AppService, ConfigService, WIN_BUILD_FLUENT_BG_SUPPORTED, isWindowsBuild, HostWindowService, HotkeyProvider, ConfigProvider, FileProvider } from 'tabby-core' -import { TerminalColorSchemeProvider } from 'tabby-terminal' +import { TerminalColorSchemeProvider, TerminalDecorator } from 'tabby-terminal' import { SFTPContextMenuItemProvider, SSHProfileImporter, AutoPrivateKeyLocator } from 'tabby-ssh' import { PTYInterface, ShellProvider, UACService } from 'tabby-local' import { auditTime } from 'rxjs' @@ -23,6 +23,7 @@ import { ElectronConfigProvider } from './config' import { EditSFTPContextMenu } from './sftpContextMenu' import { OpenSSHImporter, PrivateKeyLocator, StaticFileImporter } from './sshImporters' import { ElectronPTYInterface } from './pty' +import { PathDropDecorator } from './pathDrop' import { CmderShellProvider } from './shells/cmder' import { Cygwin32ShellProvider } from './shells/cygwin32' @@ -73,6 +74,8 @@ import { VSDevToolsProvider } from './shells/vs' { provide: PTYInterface, useClass: ElectronPTYInterface }, + { provide: TerminalDecorator, useClass: PathDropDecorator, multi: true }, + // For WindowsDefaultShellProvider PowerShellCoreShellProvider, WSLShellProvider, diff --git a/tabby-terminal/src/features/pathDrop.ts b/tabby-electron/src/pathDrop.ts similarity index 80% rename from tabby-terminal/src/features/pathDrop.ts rename to tabby-electron/src/pathDrop.ts index c18d17bf..1f96c918 100644 --- a/tabby-terminal/src/features/pathDrop.ts +++ b/tabby-electron/src/pathDrop.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core' -import { TerminalDecorator } from '../api/decorator' -import { BaseTerminalTabComponent } from '../api/baseTerminalTab.component' +import { TerminalDecorator, BaseTerminalTabComponent } from 'tabby-terminal' +import { webUtils } from 'electron' /** @hidden */ @Injectable() @@ -11,8 +11,8 @@ export class PathDropDecorator extends TerminalDecorator { event.preventDefault() })) this.subscribeUntilDetached(terminal, terminal.frontend?.drop$.subscribe((event: DragEvent) => { - for (const file of event.dataTransfer!.files as any) { - this.injectPath(terminal, file.path) + for (const file of event.dataTransfer!.files as unknown as Iterable) { + this.injectPath(terminal, webUtils.getPathForFile(file)) } event.preventDefault() })) diff --git a/tabby-terminal/src/index.ts b/tabby-terminal/src/index.ts index 76226124..a674933f 100644 --- a/tabby-terminal/src/index.ts +++ b/tabby-terminal/src/index.ts @@ -26,7 +26,6 @@ import { TerminalContextMenuItemProvider } from './api/contextMenuProvider' import { TerminalColorSchemeProvider } from './api/colorSchemeProvider' import { TerminalSettingsTabProvider, AppearanceSettingsTabProvider, ColorSchemeSettingsTabProvider } from './settings' import { DebugDecorator } from './features/debug' -import { PathDropDecorator } from './features/pathDrop' import { ZModemDecorator } from './features/zmodem' import { TerminalConfigProvider } from './config' import { TerminalHotkeyProvider } from './hotkeys' @@ -54,7 +53,6 @@ import { DefaultColorSchemes } from './colorSchemes' { provide: ConfigProvider, useClass: TerminalConfigProvider, multi: true }, { provide: HotkeyProvider, useClass: TerminalHotkeyProvider, multi: true }, - { provide: TerminalDecorator, useClass: PathDropDecorator, multi: true }, { provide: TerminalDecorator, useClass: ZModemDecorator, multi: true }, { provide: TerminalDecorator, useClass: DebugDecorator, multi: true },