Drag and drop files from the macOS terminal
Use this cool tool:
https://github.com/Wevah/dragterm
Steps to install:
- git clone the above repo
- cd dragterm
brew install cocoapodsg++ DTDraggingSourceView.m main.m -framework Cocoa -o drag- 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:
map <C-d> shell drag %p
Paste the above to .config/ranger/rc.conf to map ctrl+d to drag a file from ranger