! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[PATCH] copy file/dir in Thunar file manager and paste in a text editor or a ...
Status:
RESOLVED: FIXED

Comments

Description Duan Yao 2011-12-23 17:51:30 CET
Copy a file in Thunar file manager and paste it in in a text editor or a terminal, the pasted text is a "file://" URL instead of the absolute path of the file.
I think Thunar should paste a plain file path instead of a "file://" URL. 

This is annoying because I have to remove the prefix "file://" by hand. Even worse, if the path contains non-English characters, these are got escaped, which makes the URL not editable by hand, like this:
file:///home/duanyao/%E4%B8%8B%E8%BD%BD

I paste the file into terminal because I wan't to execute commands on it. However, none of the traditional
command line tools, like cd, ls, cat, find, tar, grep... , would accept "file://" URL!
Should these tools be fixed? I don't think so.  
"file:///abc" may also be interpreted as a relative path -- a file "abc" under a directory "file:" !
How do these tools choose?

Additionally, "file://" URIs are hardly useful on earth. 
I haven't seen a single software rely on  "file://" URI to work. Can anybody
name one? 
You can paste an absolute path like "/home/myname" into a web browser's
location bar(which expects an URL) and it will happily show the directory.
So being able to paste a "file://" URI gains almost no benefits.
 
PS, KDE dolphin file manager also has exactly the same problem:
https://bugs.kde.org/show_bug.cgi?id=241225

However, Gnome nautilus file manager paste plain file paths, which is good.
Comment 1 torquil 2012-06-11 23:34:58 CEST
Yes, please fix this. It causes a lot of problems for me because I must very often copy text from the address bar in Thunar.

In addition to the comments already made (I'm also often affected by the problems with non-English characters), it is unfortunate that

method 1: Highligh path, CTRL-c, then CTRL-v in text editor

works differently than

method 2: Highligh path, then middle-click in text editor

The latter is the sensible one, i.e. it actually copies the highlighted text, which is what I expect. However it is not always possible to use the middle-click method, and CTRL-c/v is much more robust since it avoids destruction of the buffer due to accidental highlighting of other stuff, which happens quite often for me.

Actually, I just discovered that sometimes I get the file:// part in the beginning of the text that I past into a text editor using CTRL-v, and sometimes I do not... I will have to invistigate it, but there is definitely something fishy here :-)

Best regards
Torquil Sørensen
Comment 2 Miguel Guedes 2012-07-15 16:52:14 CEST
PATCH

* Allow user-friendly copying of file selection list to clipboard.

* Add specific case for when clipboard action target accepts list of URIs.


Please find patch here: http://paste.ubuntu.com/1093293/
Comment 3 Miguel Guedes 2012-07-15 16:54:52 CEST
@Duan Yao: could you please rename this report and add the prefix '[PATCH] ' to its title so it's easier for the devs to spot it? Thanks.
Comment 4 Miguel Guedes 2012-07-16 22:06:41 CEST
Before applying the patch, please remove lines 42 and 43, as they serve no purpose other than debugging:

+      for(i = 0; uris[i]; i++)
+        printf("> %d: %s\n", i, uris[i]);
Comment 5 Duan Yao 2012-07-17 03:23:43 CEST
(In reply to comment #3)
> @Duan Yao: could you please rename this report and add the prefix '[PATCH] '
> to its title so it's easier for the devs to spot it? Thanks.
Done.
Thank you for your patch!
Comment 6 Nick Schermer editbugs 2012-09-27 20:54:53 CEST
Fixed in c69f40c.

Bug #8271

Reported by:
Duan Yao
Reported on: 2011-12-23
Last modified on: 2012-09-27

People

Assignee:
Jannis Pohlmann
CC List:
4 users

Version

Attachments

Additional information