-
-
Notifications
You must be signed in to change notification settings - Fork 79
FileOperations: Re-escape uris from Clipboard or DNDHandler before use in fileoperations #2616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code LGTM but I can't confirm (repro) the fix works...
When dragging a file with '#' in its name into the Terminal, the pasted path gets cut off after '#' |
A bug has now been identified so dismissing approval in case of accidental merging.
Nautilus seems to have the same problem (with Pantheon Terminal). |
Cut and paste works correctly. |
This appears to be a bug in Terminal not Files - the "sanitization" of dropped uris is causing this truncation. |
See #877 for Terminal fix. |
Hmmm just tested in a VM. It does fix D&Ding the |
@zeebok Thanks for the review - it is hard to fix this problem without introducing problems elsewhere hence the need for multiple testers. There is a Terminal PR to fix handling |
@zeebok I cannot reproduce the problem with pasting into Code I am afraid (using current master version of Code on OS8). I notice that pasting from other file managers into Terminal also truncates confirming that it is a Terminal bug. |
I can conform that pasting into Music is problematic. I suspect it is because Files is including the |
Hmm, I now cannot reproduce the Music issue after recompiling Music from source, neither on version 8.0.0 or version 7.0.0 of Music, at least with files not containing There is a problem similar to Terminal in Music where the URI of files is truncated at the first occurrence of |
@zeebok I'd be grateful for your review after the latest commits. I noticed that Files was only providing the TargetType TEXT_URI_LIST to other apps - I've fixed that although I don't think it is related to this issue necessarily. I've also tried to clarify the code a little with better names and comments. I suggest you test using Music compiled from source as the current release has issues with dropped files. I also suggest testing with Terminal compiled from elementary/terminal#877. I could not get dropping onto Amberol to work - maybe because it is a Gtk4 app and DnD is done differently? I think any issues with 3rd party apps will have to be left for another PR. |
Fixes #2615
After #2268 files being copied or dragged have their name sanitized before being given to the recipient so that they appear correctly when pasted/dropped as text. However, they were not being re-escaped when used in a file operation and this caused the operation to fail for some files. This PR fixes that.
After this PR, copy/dragging a file should work both to a text document or terminal and to another folder in Files (or Dolphin or Nautilus at least).
Note that Dolphin does not unescape filenames when transferred as text but Nautilus does.