2

Usually, when I drag a link to the terminal, the link target is pasted in the terminal. However, when I just dragged a FTP link from Chromium to my Terminal (first result on Google for "ftp pdf", ftp://ftp.ipswitch.com/ipswitch/manuals/ftpserv.pdf), a file download was immediately initiated (I knew because a desktop notification appeared).

I tried to locate the downloaded file using find ~ -iname '*.pdf' (also in /tmp), but I didn't find any traces. When I tried to reproduce the problem by dragging the ftp-URL again, the download completed much faster than before, from which I infer that the file is still cached, somewhere.

So, my question are:

  • Why is the ftp resource being downloaded after I drag the link to my Terminal?
    (instead of being pasted as text, like http-URLs)
  • Where can I find the downloaded file? (I want to delete it)
  • Which terminal and version are you using? Gnome Terminal? – Timo Jan 15 '14 at 19:24
  • @Timo The default terminal emulator of KDE, Konsole ( konsole.kde.org). Version 2.12 using KDE Development Platform 4.12.0 and Qt 4.8.5 – Rob W Jan 15 '14 at 20:55
  • Did you check in whatever directory you were in in the terminal? – Jenny D Jan 16 '14 at 15:56
  • @Jenny Yes, of course. – Rob W Jan 16 '14 at 19:02
  • It seems that the answer might be "nowhere". The notification has title "Login OK [finished]" and the FTP URL as message, but nothing actually happens. When I look in ps, I find kio_ftp. After "Logging in", dragging the URL will now open a contextmenu that prompts for the desired action (Copy, move, paste URL, etc.). Not sure if it is the same problem as before, but dragging FTP URLs continues to be problematic (KDE 4.14.9, Konsole 2.14.2). – Rob W Jul 11 '15 at 17:59
1

Why is the ftp resource being downloaded after I drag the link to my Terminal? (instead of being pasted as text, like http-URLs)

The resource is not being "downloaded", but queried for its path and type. When dropping a file or URL on Konsole, it will try to convert it to a URL or path. Try for instance dropping a file:///tmp/ URL from Firefox to Konsole, it will instead show up as /tmp/. Another reason why this status call is needed is to check whether it is a directory or not (so you can drop a directory and select Change Directory To.

For this status discovery, Konsole depends on various protocols to provide a KIO interface. Now usually you should get a menu with Copy Here, Move Here, Link Here and Paste Location options. However for some reason (presumably a race condition bug?), the menu is not always offered and a download is immediately started (relevant code is in TerminalDisplay::dropEvent).

This was observed in Konsole 15.08.0 (Qt 5) on Arch Linux by the way.

Where can I find the downloaded file? (I want to delete it)

There is a good chance that the file was not actually saved and so you do not need to delete it. If you think it is still somewhere, look in /proc/$pid/fd/ for file descriptors of your process (or invoke lsof). (Have you also tried /var/tmp/ besides /tmp and ~?)

In the next 15.xx version, a new option is available to disable this Drag 'n' Drop functionality and simply paste everything as text (bug 304290). You can find this by opening your Profile settings, tab Mouse, option Disable drag and drop menu for URLs and files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.