! 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 !
Terminal should parse file uris after drag-and-drop action with text/uri-list...
Status:
CLOSED: FIXED
Product:
Xfce4-terminal
Component:
General

Comments

Description Jaap Karssenberg 2006-07-27 09:04:38 CEST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.3) Gecko/20060504 Firefox/1.5.0.3
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.3) Gecko/20060504 Firefox/1.5.0.3

The text/uri-list drag-and-drop format contains a \r\n seqence after each uri. At the moment it seems that after dropping an uri list in terminal the text content of the text/uri-list data is copied to the terminal without further parsing. The result is that the first uri in the list is inserted directly followed by a <return> and the command you were typing is executed. For a terminal it would make more sense to parse the data of the text/uri-list. For example convert the file:// uris to normal paths, apply (posix) shell quotes when the path contains for example spaces, and insert the list separated by spaces. This way you get a valid set of commandline arguments after dropping an uri list. This would improve the cooperation between terminal and file browsers like thunar.

Note that terminal seems to do the file:// uri to path conversion already, but doesn't do quotes or escapes, making it impossible to use drag and drop on files containing whitespace.

Note that when dragging from nautilus to terminal all paths are inserted on the same line. Is this a text/plain drag-n-drop target at work ?


Reproducible: Always

Steps to Reproduce:
1. Drag one or more files from a file browser
2. Drop them in terminal
3. Each file path is inserted directly followed by a <return>

Actual Results:  
The command you were typing begore the drag-drop action is excuted by the drop. Which is almost never what you intended. The un-expected command execution is BAD and can do serious damage.

Expected Results:  
The file paths should at least be inserted on one line separated by whitespace. Thus preveting the un-expected execution of a command. Preferable the paths should also be inserted with shell escapes applied.

See the discussion on the thunar email list "Two feature requests" July 2006.
Comment 1 Benedikt Meurer editbugs 2006-08-12 16:28:37 CEST
Created attachment 724 
Possible patch

Try this patch. Should do what you want (avoiding unnecessary quoting, tho).
Comment 2 Benedikt Meurer editbugs 2006-08-26 16:09:46 CEST
Fixed with revision 22888.

2006-08-26	Benedikt Meurer <benny@xfce.org>

	* terminal/terminal-widget.c: Parse file:-URIs dropped to a Terminal
	  window properly and format them so they can be used in shell commands
	  directly without having to worry about quoting. Bug #2076.

Bug #2076

Reported by:
Jaap Karssenberg
Reported on: 2006-07-27
Last modified on: 2009-12-17

People

Assignee:
Benedikt Meurer
CC List:
0 users

Version

Version:
unspecified

Attachments

Possible patch (2.59 KB, patch)
2006-08-12 16:28 CEST , Benedikt Meurer
no flags

Additional information