ish
ish copied to clipboard
Drag and drop support
Hello 👋,
I believe that adding support of drag and drop to iSH would be great. Here is how and why: when you work on a file or directory (of a website for example) and you need to compile the code inside the folder; you can simply drag and drop the folder as a ZIP (or possibly another format) on the TerminalView
and it's getting copied to the current directory on iSH.
Once you've finished, you can drag the folder icon on the bar sitting on top of the keyboard to your other app, and you can continue on the other app.
I think it would make iSH a bit more "desktop-like", as you can already drag and drop on a terminal.
That sounds annoying to implement, but potentially quite useful. Among the difficulties: finding the current directory is hard, actual terminals put the file in a temporary directory and paste the path.
It can be simplified by just copying the folder / file to the ~
folder, and inserting its path on the input
What if there's already a file with that name? What if the user doesn't want their home directory to get cluttered up? What if the user has deleted their home directory for whatever reason?
For the file name problem, it's easy to do what every other file system does: appending a -2
to the file name. And the other questions can be solved by adding a "default drop path" options in the About view
Adding a default drop path setting doesn't solve the problem of the directory not existing, and adding -2
is kinda disgusting to me.
How about there's a directory created in the root, /ios
, and drag/drop files go in uniquely named subdirectories of /ios/dnd
? /ios
would also be a good place to put files shared through the share sheet, etc.
This is an excellent idea 💡
@tbodt I know it's an old issue, but I would really like to implement drag and drop into your app. Could you just tell where can I start implementing a such thing. Especially the /ios
part (how can this directory be created?). For the drag and drop part, I think I can totally do it without help
In the AppDelegate.m there's a generic_mkdirat call to create /dev/pts if it doesn't exist. You can do the same thing to create /ios and /ios/dnd.
@arguiot did you find some time to look at the implementation? Even if it's a stub - could you publish it?