> For the complete documentation index, see [llms.txt](https://til.aldrinjenson.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://til.aldrinjenson.com/tools-and-workflow/adding-drag-drop-from-terminal-in-mac-os.md).

# Adding drag-drop from terminal in macOS

Use this cool tool:

{% embed url="<https://github.com/Wevah/dragterm>" %}

### Steps to install:

1. git clone the above repo
2. cd dragterm
3. `brew install cocoapods`
4. `g++ DTDraggingSourceView.m main.m -framework Cocoa -o drag`
5. Add the folder to PATH

`export PATH="<your drag term folder path>:$PATH"`

### Usage:

`drag <filename>`

### Bonus

If you are using `ranger` or some other CLI based file manager, you can easily add support to dragging from terminal using `dragterm` with a key-map as follows:

```bash
map <C-d> shell drag %p
```

Paste the above to `.config/ranger/rc.conf` to map ctrl+d to drag a file from ranger


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://til.aldrinjenson.com/tools-and-workflow/adding-drag-drop-from-terminal-in-mac-os.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
