(terminal: BaseTerminalTabComponent<BaseTerminalProfile>)
| 7 | @Injectable() |
| 8 | export class PathDropDecorator extends TerminalDecorator { |
| 9 | attach (terminal: BaseTerminalTabComponent<BaseTerminalProfile>): void { |
| 10 | setTimeout(() => { |
| 11 | this.subscribeUntilDetached(terminal, terminal.frontend?.dragOver$.subscribe(event => { |
| 12 | event.preventDefault() |
| 13 | })) |
| 14 | this.subscribeUntilDetached(terminal, terminal.frontend?.drop$.subscribe((event: DragEvent) => { |
| 15 | for (const file of event.dataTransfer!.files as unknown as Iterable<File>) { |
| 16 | this.injectPath(terminal, webUtils.getPathForFile(file)) |
| 17 | } |
| 18 | event.preventDefault() |
| 19 | })) |
| 20 | }) |
| 21 | } |
| 22 | |
| 23 | private injectPath (terminal: BaseTerminalTabComponent<BaseTerminalProfile>, path: string) { |
| 24 | const shellType = this.getShellType(terminal) |
nothing calls this directly
no test coverage detected