Ticket #5376 (new enhancement)

Opened 7 years ago

Last modified 7 years ago

DnD does not work in Terminal.activity

Reported by: bernie Owned by: edsiper
Priority: high Milestone: 8.2.0 (was Update.2)
Component: terminal-activity Version:
Keywords: Cc: Eben, tomeu, legutierr
Action Needed: Verified: no
Deployments affected: Blocked By:
Blocking:

Description

gnome-terminal uses shift-ctrl-c and shift-ctrl-v to copy and paste.

Also, it would be nice for the terminal to understand drop events from the clipboard, like Write does.

Change History

follow-up: ↓ 4   Changed 7 years ago by tomeu

  • cc Eben, tomeu added

I would like to note that accepting drops and offering drags (and c&v) is no different in sugar than in other X-based environment.

So just following the pygtk tutorial on that or stealing the code from gnome-terminal should work.

Eben, you have anything to say here? Should we have buttons in the toolbar? Which shortcuts should we use?

  Changed 7 years ago by erikos

Great i thought of that feature the other day. Another functionality I use often is the possibility to select text and insert it in another application with the middle mouse button or by pressing the left and right mouse button at the same time. I know from bernie that the latter can not easily achieved at the moment but maybe worth thinking bout it.

follow-up: ↓ 6   Changed 7 years ago by jg

  • priority changed from normal to high
  • milestone changed from Never Assigned to Update.1

heh. The lack of this makes it *really* painful to deal with things like developer keys.

What you want to be able to do, for example, is to cut the right string the developer key page gives you and paste the wget into the terminal.

Right now, you get to retype.

If the fix is easy, I'm in favor of getting this in sooner rather than later....

in reply to: ↑ 1   Changed 7 years ago by Eben

Replying to tomeu:

Eben, you have anything to say here? Should we have buttons in the toolbar? Which shortcuts should we use?

Yes, the toolbar should definitely have copy/paste buttons. We may also add a clear button (with a secondary option which clears the scrollback buffer), and other similar functions.

As for shortcuts, I think someone suggested that we can use the standard ones as long as we also include the shift modifier. This seems reasonable to me if that's the case. Shift and control are easy to hit together, so it should be easy enough to type.

  Changed 7 years ago by legutierr

  • cc legutierr added

Right-click is a common terminal shortcut for copy and/or paste (or both) on other platforms (Solaris, Windows for example). Perhaps that functionality could also be added when the keyboard shortcuts are added?

One possible implementation: right click with nothing highlighted pastes to the commandline, right click with something highlighted writes what is highlighted to the clipboard and un-highlights the text.

in reply to: ↑ 3   Changed 7 years ago by grettke

Replying to jg:

heh. The lack of this makes it *really* painful to deal with things like developer keys. What you want to be able to do, for example, is to cut the right string the developer key page gives you and paste the wget into the terminal. Right now, you get to retype.

It is sort of interesting, not being able to paste into the terminal for wget results in folks downloading into the datastore, and the submitting new ticket one can not copy out of the datastore at the command line:

http://dev.laptop.org/ticket/5571

  Changed 7 years ago by isforinsects

A five line script placed in terminal's /bin would solve the issue for the time being. At the very least it would save a *lot* of trouble for the support team walking users through commands.

"highlight this" "copy it" "Type pbpaste"

That would be a lot easier than asking someone to type 40+ characters of (to them) gibberish.

#!/usr/bin/python
import gtk
import pygtk
cb = gtk.clipboard_get(selection = "PRIMARY")
print cb.wait_for_text()

  Changed 7 years ago by isforinsects

Alternatively you could make these changes to the terminal activity:

http://www.cs.washington.edu/homes/supersat/terminal.diff

That .diff shows how to make right click do paste

  Changed 7 years ago by jg

tomeu, I really would like this cut and paste fix, at least the patch there.

This is a top support request...

  Changed 7 years ago by supersat

This patch may need some refinement. In particular, I've occasionally been able to get the terminal into a state where right-clicking doesn't work, but middle clicking does. The log viewer says:

(sugar-activity:2122): Vte-CRITICAL **: vte_terminal_paste_primary: assertion `VTE_IS_TERMINAL(terminal)' failed

  Changed 7 years ago by tomeu

Terminal-6.xo has c&v support using shit+ctrl+c and shit+ctrl+v. Also uses the standard Edit toolbar.

Paste on right click can wait for another milestone if Eben agrees first.

Drag and drop support would be nice to have. Eduardo, tell me if you want help on that.

  Changed 7 years ago by Eben

I think that the shift modifier is a good way to go, especially as it generalizes for any other shortcuts as well. I don't think that we'll actually need to implement the right-click approach to this at all.

Of course, I want drag'n'drop to be ubiquitous everywhere, so I'd still be in favor of adding that down the line.

  Changed 7 years ago by jg

  • summary changed from copy & paste does not work in Terminal.activity to DnD does not work in Terminal.activity
  • milestone changed from Update.1 to Update.2

Stupendous. One of the major hassles bite the dust; and yes, for update.2 it would be good to get DnD done....

So rather than closing this, I'm going to retarget and rename for Update.2...

  Changed 7 years ago by AlbertCahalan

gnome-terminal and xterm also paste on:

1. middle click (unless the program in the terminal asks for mouse events, which is very rare)

2. middle click with shift

As these are pretty much standard and do not conflict with other requirements, they really need to work. Allowing right click in place of middle click might be wise, since pressing two buttons to make a middle click isn't all that easy.

follow-up: ↓ 16   Changed 7 years ago by tgape

Note that the whole drag-n-drop concept does not work to copy from Write into Terminal, and vice versa, so long as all of the applications are always full-screen. And, I don't think the screen's really big enough to viably fix that by allowing applications to window...

Incidentally, the old unix standard of shift-insert works fine for paste, except that there's no way to do that on the native keyboard.

in reply to: ↑ 15   Changed 7 years ago by tomeu

Replying to tgape:

Note that the whole drag-n-drop concept does not work to copy from Write into Terminal, and vice versa, so long as all of the applications are always full-screen. And, I don't think the screen's really big enough to viably fix that by allowing applications to window...

Hi, the idea is that you drop from the source activity to the frame and from there to wherever you want. This is the "discoverable" way.

Incidentally, the old unix standard of shift-insert works fine for paste, except that there's no way to do that on the native keyboard.

In Sugar, Ctrl-C and Ctrl-V are used (we'll have accelerators with labels in the next release after update.1). This is the "quick" way.

Note: See TracTickets for help on using tickets.