The register published an article about this last month. Titular "frame" is addressed first, but the story also describes XLibre, wayback, arcan, and others
There are lots of ways to move data between or within graphical windows! But the list is shrinking
- clipboard - cltr-c / ctrl-v
- drag and drop - mouse selection, mouse drag
- primary - mouse selection -> middle click (or shift+ins); moves text cursor
- secondary - ctrl+select (alt+select in emacs); secondary doesn't move text cursor. largely forgoten. motif, patched gtk; not in qt, tk, mainline gtk, etc
- cut-buffer - deprecated everywhere. set by application using X11 window property for state
It's in emacs! Using alt instead of ctrl https://www.gnu.org/software/emacs/manual/html_node/emacs/Secondary-Selection.html
Why's that?
You're describing the primary selection. The article's about patching secondary selection back into gtk3 (c. 2015?). It's ctrl+select followed by ctrl+middle to paste as yet another clipboard. This has the unique and useful property that neither selection nor paste changes the text cursor's position.
A more in-depth look at secondary selection is in the embedded video which has it's own write-up on https://www.cs.man.ac.uk/~lindsec/secondary.html
[I suspect primary-secondardy selection is not a confusion you have, but one a casual skip-the-article-direct-to-comments reader might have]
And the keyboard shortcut for primary clipboard paste (Shift+Ins) is already gone from gtk.
- https://gitlab.gnome.org/GNOME/gtk/-/issues/352 (closed)
- https://bugzilla.mozilla.org/show_bug.cgi?id=1070518 (open)
- There's a nice Q/A on stackexchange: "Why does Shift+Insert paste from CLIPBOARD in some applications and PRIMARY in others?"
For interactive editing, the keybind alt+. inserts the last argument from the previous command. Using this instead of $_ has the potential to make your shell history a little more explicit. (vim $_ isn't as likely to work a few commands later, but vim actual_file.sh might)
https://atuin.sh/ does one better. history with context: $PWD, $HOST, time. There's a bunch of other bells and whistles, but they're easy to ignore to get an noninvasive upgrade to ctrl+R