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.
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
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/
@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.
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]);
(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!
Fixed in c69f40c.