dsh-plugin-drone
English | 中文

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-droneFeatures
- 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
flextrekservice 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 theFlextreckServiceservice on load.FlextreckService(service): callslistenExplorerDragFilesfrom@initencounter/flextrekto register a global drag listener; whenever files are dragged out of Explorer, it emitsctx.emit('flextrek-drag', files). The listener is unregistered when the service isdispose()d.
The underlying @initencounter/flextrek is a Windows binding built on the flextrek-rs Rust crate, so it is Windows x64 only.
Events
| Event | Payload | Description |
|---|---|---|
flextrek-drag | string[] | Absolute paths of the files / folders dragged out of Explorer |
Services
| Service | Description |
|---|---|
flextrek | Holds 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
flextreknative binding currently supportswin32-x64-msvconly) - Node.js runtime
LICENSE
[AGPL-3.0](LICENSE)