Question

It has been shown in this forum that gitk works with the native OS keys to copy/paste for example into the SHA1 ID line: see unable to copy and paste in gitk - macosx and How to copy text in gitk

My question is why doesn't this functionality appear in a menu item under Edit?

Is there some blockage to being able to do that?

See also this reference for a good overview of gitk in the answers:
Guide to understanding gitk?

Was it helpful?

Solution

Regarding copy/paste support between Tk and other Apps, this wiki page sums it up:

Q9. When I copy from a Tcl/Tk app on OS X, then quit that app, the text I copied doesn't appear in the system-wide paste buffer.
I need to switch focus to something else while the Tk app is still running for cross-app copy/paste to work as expected. I'm using Tcl/Tk 8.10 on Leopard, though I had the same problem with 8.7 on Tiger. Any way around this?

A9. SLB: I cannot answer specifically for OS X but a similar problem occurs on Windows.
I did investigate that and found that Windows provides two methods for storing information in the clipboard:

  • you can copy the textinto the clipboard or
  • you can store in the clipboard a reference to the application holding the text.

The latter is more efficient when the amount of text is very large but means the information is lost when the application terminates.
This is the only form of copy offered by Tk.
Resolving it would require a TIP to extend clipboard support in Tk.

So copy/paste between an app and a Tk app might not be easy right now...


Original answer:

Having work with gitk all day long today, I can see there is no "focus" even on the left-bottom panel of gitk, where diff of content are displayed.

I.e. clicking in that panel doesn't trigger anything for the other panels.

In other words, the gitk GUI doesn't monitor the mouse click/selection events in that panel, and only native clipboard capability applies in it.

It seems coherent that the 'Edit' menu don't reflect any copy/paste entry, since gitk don't monitor those selections events.
As it is, 'Edit' is only there to edit the preferences.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top