GNOME Bugzilla – Bug 700951
terminal: dragging file from Nautilus should paste file path
Last modified: 2019-03-23 20:34:02 UTC
When I drag a file from Nautilus to a standalone gnome-terminal window, its path gets pasted into the terminal. That's convenient. But when I drag to an embedded terminal in gedit, the file opens in a new gedit tab. It would be nicer if instead the file path were pasted in, just like in an external gnome-terminal. (By the way, it's also possible to drag files from the gedit file browser, which is another use case for this.)
mmm, not sure about this.... while I like the idea it would mean to drop the feature where you can drop a file not only in the view but in the rest of the window.
I also don't want to drop that feature! I think if you drop in the terminal it should paste the path, but if you drop elsewhere it should open the file. Not sure how easy that would be. :)
I have to check more... maybe we would need some kind of extension point in the window to handle the drop... dunno I will have to ask somebody with more experience in drag and drop. pbor?
So I was thinking a bit more on this, we can simply have our own subclass of VteTerminal and handle the drag and just chain up if it is different than a uri what we get. This is similar to what we do right now in GeditView.
Can you please try it out?
I tried out your change. Looks promising, but when I drag into the embedded terminal, it pastes in a URL like this: 'file:///home/adam/foo' But when I drag from Nautilus into an external gnome-terminal, I get this: '/home/adam/foo' This latter form is more useful. Can we make the embedded terminal paste that?
I don't know how I missed that, thanks for pointing it out. Now it should be fixed.
Working great now - thanks!