|
| 1 | +Drag and Drop |
| 2 | +================================================== |
| 3 | + |
| 4 | +.. only:: man |
| 5 | + |
| 6 | + Overview |
| 7 | + -------------- |
| 8 | + |
| 9 | + *Drag and drop of files from the shell* |
| 10 | + |
| 11 | +.. highlight:: sh |
| 12 | + |
| 13 | + |
| 14 | +The ``dnd`` kitten can be used to drag and drop files between |
| 15 | +the shell and arbitrary GUI programs, it even works over SSH, so you |
| 16 | +can easily and seamlessly transfer files from one computer to another, |
| 17 | +simply by dragging from one kitty window to another. |
| 18 | +Using it is as simple as:: |
| 19 | + |
| 20 | + kitten dnd file-to-drag.xyz |
| 21 | + |
| 22 | +Then, start dragging with the mouse inside the window, and :file:`file-to-drag.xyz` |
| 23 | +will be dragged and you can drop it onto a GUI file manager or another window |
| 24 | +running this kitten. You can specify directories as well to drag entire trees. |
| 25 | + |
| 26 | +Similarly, dropping works by running the kitten:: |
| 27 | + |
| 28 | + kitten dnd |
| 29 | + |
| 30 | +Then, drag some files from a GUI file manager or another window running the dnd kitten |
| 31 | +and drop them onto this window. The files will be copied or moved (depending on |
| 32 | +which area you drop them) into the current working directory. |
| 33 | + |
| 34 | +The best part is this works even over SSH. So if you just want to quickly |
| 35 | +transfer some files from one computer to another all you need to so is ssh into |
| 36 | +the remote computer:: |
| 37 | + |
| 38 | + kitten ssh remote-computer-name |
| 39 | + |
| 40 | +Then, run the dnd kitten on the remote computer:: |
| 41 | + |
| 42 | + kitten dnd files-or-dirs-to-drag |
| 43 | + |
| 44 | +That's it, you can now drag form or drop to the remote computer. See below for |
| 45 | +customising the behavior of the kitten via command line flags. |
| 46 | + |
| 47 | +This kitten uses a new protocol developed by kitty to function, for details, |
| 48 | +see :doc:`/dnd-protocol`. |
| 49 | + |
| 50 | +.. program:: kitty +kitten dnd |
| 51 | + |
| 52 | + |
| 53 | +.. include:: /generated/cli-kitten-dnd.rst |
0 commit comments