Skip to content

Fix dropping files with '#' in name#877

Closed
jeremypw wants to merge 3 commits intomasterfrom
jeremypw/fix-dropped-urilist
Closed

Fix dropping files with '#' in name#877
jeremypw wants to merge 3 commits intomasterfrom
jeremypw/fix-dropped-urilist

Conversation

@jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented Jul 16, 2025

Fixes #876

Dropped uris were being sanitized by creating a file from them and then obtaining the path but this seems unnecessary and was causing truncation.

@Marukesu
Copy link
Contributor

Marukesu commented Jul 16, 2025

If the external application is sending files URIs, then he should be escaping those '#' in the filename as it denotes the start of the fragment part of the URI.

@Marukesu
Copy link
Contributor

If the external application is sending files URIs, then he should be escaping those '#' in the filename as it denotes the start of the fragment part of the URI.

That being said, I don't think we should be removing the scheme as the code implies it does. We don't know the intent of those URIs. Even in the 'file://' case, we don't know if they are local or not.

@jeremypw
Copy link
Collaborator Author

@Marukesu Could you raise a separate issue if there is a demonstrable downside to removing the "file://" scheme? This PR does not affect that behaviour.

As far as I can tell Terminal only uses dropped files as files if they are dropped on the "Add Tab" button. Dropping on the Terminal widget just converts to text. I considered removing URILIST target type but although that works you then get paste warnings.

@jeremypw jeremypw added this to the 7.1 milestone Jul 23, 2025
@jeremypw jeremypw removed this from the 7.1 milestone Jul 31, 2025
@jeremypw jeremypw marked this pull request as draft July 31, 2025 12:13
@jeremypw jeremypw marked this pull request as ready for review August 7, 2025 18:20
@jeremypw jeremypw added this to the 7.1.1 milestone Aug 7, 2025
@jeremypw jeremypw requested a review from a team August 8, 2025 18:44
@jeremypw
Copy link
Collaborator Author

Closing in favor of #894 for now. This PR also fixes dropping with Files but that should be fixed in Files.

@jeremypw jeremypw closed this Aug 14, 2025
@lenemter lenemter deleted the jeremypw/fix-dropped-urilist branch August 16, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dropping a file with '#' in the name causes truncation

2 participants