dsh-plugin-drone

August 21, 2026 · View on GitHub

English | 中文

npm version

Smoothly drag files / folders from Windows Explorer into dsh.

When you press the left mouse button in Explorer and drag files out, the plugin captures the drag through a native binding and broadcasts the dragged paths to the dsh context as a flextrek-drag event, so other modules can pick them up for further processing (for example, adding them to the current session's context).

Install

dsh plugin --profile web add dsh-plugin-drone

Features

  • Listens for files / folders dragged out of Windows Explorer (fires on drag, no hotkey needed)
  • The drag event carries an array of absolute paths of the dragged items
  • Registered as a flextrek service whose lifecycle is managed by cordis; the listener is unregistered automatically on dispose

How it works

The plugin is built on dsh's cordis framework and consists of two parts:

  • Drone (plugin entry): mounts the FlextreckService service on load.
  • FlextreckService (service): calls listenExplorerDragFiles from @initencounter/flextrek to register a global drag listener; whenever files are dragged out of Explorer, it emits ctx.emit('flextrek-drag', files). The listener is unregistered when the service is dispose()d.

The underlying @initencounter/flextrek is a Windows binding built on the flextrek-rs Rust crate, so it is Windows x64 only.

Events

EventPayloadDescription
flextrek-dragstring[]Absolute paths of the files / folders dragged out of Explorer

Services

ServiceDescription
flextrekHolds the drag listener; unregisters all handles on dispose()

Usage

Subscribe to the event in dsh to consume drag results, for example:

ctx.on('flextrek-drag', (files) => {
  console.log('Dragged files:', files)
})

Requirements

  • Windows x64 (the flextrek native binding currently supports win32-x64-msvc only)
  • Node.js runtime

LICENSE

AGPL-3.0